AppWorx, Dollar Universe and Sysload Community

Expand all | Collapse all

Facing issue in the following code(highlighted in bold)!! (&SO_KEY#[])

  • 1.  Facing issue in the following code(highlighted in bold)!! (&SO_KEY#[])

    Posted 10-28-2019 03:14 PM
    :SET &SOOD_INFO# = PREP_PROCESS_REPORT(,,,"*SOOD-ROW*","COL=DELIMITER,DELIMITER=','")
    :PROCESS &SOOD_INFO#
    : SET &OBJDES# = GET_PROCESS_LINE(&SOOD_INFO# ,5)
    : SET &OBJDES# = STR_TRIM(&OBJDES#)
    : SET &UPPER_OBJDES# = STR_UC(&OBJDES#)
    : SET &REQ_DOC# = '********* Invi docu*'
    : SET &REQ_DOC# = STR_UC(&REQ_DOC#)
    : SET &DOC_RES# = STR_MATCH(&UPPER_OBJDES#,&REQ_DOC#)
    : IF &DOC_RES# = 'Y'
    : SET &MAIL_INFO# = GET_VAR( VARA.NON_PROD.TABLE_INFO,&KEY#,4)
    : SET &MAIL_INFO# = STR_CAT(&MAIL_INFO#,'&OBJDES#<V>')
    : PUT_VAR_COL VARA.NON_PROD.TABLE_INFO,&KEY#,4,&MAIL_INFO#
    ! ----------------------------------------
    : DEFINE &MAIL_INFOS#,STRING,5
    : FILL &MAIL_INFOS#[] = STR_SPLIT(&MAIL_INFO#,"<V>")
    : SET &MAIL_INFOS#[2] = STR_TRIM(&MAIL_INFOS#[2])
    : SET &ADCP_CHECK# = ISNUMERIC(&MAIL_INFOS#[2])
    : DEFINE &SO_KEY#,STRING,2
    : SET &SO_KEY#[1] = STR_CAT(&MAIL_INFOS#[5],'_SND')
    : IF &ADCP_CHECK# = 'Y'
    : SET &SO_KEY#[2] = STR_CAT(&MAIL_INFOS#[2],'_REC')
    : ENDIF
    : PUBLISH &SO_KEY#[],,WORKFLOW
    ! ----------------------------------------
    : ELSE
    : DELETE_VAR VARA.NON_PROD.TABLE_INFO,&KEY#
    : ENDIF
    :ENDPROCESS


    :PUBLISH &DOC_RES#,,"WORKFLOW"

    If value of &MAIL_INFOS#[2] which is fetched from vara is numeric then the above code works fine, but if the &MAIL_INFOS#[2] value is not numeric (consider alphabetic), then the above code returns the following error - "line '00021'. 'U01001341 The index '2' is outside of the valid area of the array 'SO_KEY#'.'." which is not suppose to happen as per code. Please let me know that what is the issue, is it problem in code or any changes to be done in the object settings?


  • 2.  RE: Facing issue in the following code(highlighted in bold)!! (&SO_KEY#[])

    Posted 10-29-2019 08:05 AM
    Hi,

    have you checked the content of the variable &ADCP_CHECK#?


    I am not sure, if ‚Y' is the correct content to check against.
    Just print it before the if.

    Best Regards
    Stephan


  • 3.  RE: Facing issue in the following code(highlighted in bold)!! (&SO_KEY#[])

    Posted 10-29-2019 08:56 AM
    Yeah, I did check &ADCP_CHECK# value and it will be either 'Y' or 'N'.

    ------------------------------
    [Developer]
    [Capgemini]
    ------------------------------



  • 4.  RE: Facing issue in the following code(highlighted in bold)!! (&SO_KEY#[])

    Posted 10-31-2019 04:55 AM
    Hi,
    please run the object using "execute once..." and then go to "Test Options" and activate the options "original script" and "Modifications of Variables" and post the detailed debug report.
    Thank you!