Skip to Content
avatar image
Former Member

Assign field symbol statement give runime error

This code gives runtime error:

ASSIGN (c_accit) TO <fs_accit>.

where ASSIGN c_accit has value => '(SAPLRWCL)T_ACCIT[]',

declaration

c_accit TYPE char20 VALUE '(SAPLRWCL)T_ACCIT[]',

The ASSIGN statement gives short dump. It does not give dump initially. This code is inside an exit and the exit gets called

a couple of time before we have this dump. Each time when the exit is called..it works perfectly...untill suddenly at one call this ASSIGN statement gives runtime error.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

6 Answers

  • Best Answer
    Sep 10, 2010 at 03:09 PM

    Hi,

    could you please let know the type behind the field symbol...

    Regards,

    Sitakant....

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Li,

      Sorry I did not get your point initially...yes tables parameter in function module interface is called by reference.

      Though i really did not understand why it did not dump in the first place. Probably the reference variable was loaded then!!

      i tried to simulate the scenario..and it did gave dump consistently.

      FIELD-SYMBOLS: <lf_updt_evtlog> TYPE zxs_updt_evtlog,

      <lf_updt_evtlog1> TYPE zxs_updt_evtlog .

      CONSTANTS: c_reference TYPE char30 VALUE '<LF_UPDT_EVTLOG1>'.

      ASSIGN (c_reference) TO <lf_updt_evtlog>.

      This always gave dump GETWA_NOT_ASSIGNED.

      Many thanks to you.

      Pratik.

  • avatar image
    Former Member
    Sep 11, 2010 at 12:48 PM

    Hi,

    One additional thought - do you ever change the contents of the c_accit field? I don't want to assume it's a constant by the prefix...

    c_accit TYPE char20 VALUE '(SAPLRWCL)T_ACCIT[]',

    If you never change the contents of this variable then, then this shouldn't help make a difference but where you assign the field symbol, maybe it's worth trying a hard-coded (not pretty) value, ie.

    ASSIGN ('(SAPLRWCL)T_ACCIT[]') TO <fs_accit>.

    Like I said, if this really is a constant, shouldn't make a difference but since c_accit is only 20 characters, if you change the value then 20 characters might not be enough.

    Also, could you please provide the code section from the short dump, indicating the line where the error is occurring? Just wanted to confirm it's showing the ASSIGN command as the point of failure. Also, if you could check that C_ACCIT is populated as you think when the ASSIGN command is executed, when it fails...

    Thanks, Andy

    Add comment
    10|10000 characters needed characters exceeded

  • Sep 11, 2010 at 01:39 PM

    is this is a global variable T_ACCIT[]?

    check for its value at the time when you are getting this dump, it could be a data issue

    and in ST22 analyse the cause for the error, why the field symbol ends up in dump, check this..

    Thanks

    S.Janagar

    Edited by: Janagar Sundaramoorthy Nadar on Sep 11, 2010 3:40 PM

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Janagar and Pratik,

      T_ACCIT is a tables interface in function modules

      AC_DOCUMENT_CREATE

      AC_DOCUMENT_GENERATE

      Both functions are in function group RWCL and have globalized interface (obsolete technique, says SAP) so the field T_ACCIT is known in all subroutines called from there.

      That means, that T_ACCIT is available only if the exit function gets called (indirectly) from those functions. If the exit is called from one of the other functions in the group, i.e.

      AC_DOCUMENT_COMPRESS_CHECK
      AC_DOCUMENT_CVTYP_GET
      AC_DOCUMENT_DELETE
      AC_DOCUMENT_DISPLAY_INTERNAL
      AC_DOCUMENT_GETAPPLLINKS
      AC_DOCUMENT_MM_NO_UPDATE
      AC_DOCUMENT_MM_UPDATE
      AC_DOCUMENT_POST
      AC_DOCUMENT_QUANTITY_GET
      AC_DOCUMENT_RECORD
      AC_DOCUMENT_REVERSE
      AC_DOCUMENT_SENDER
      AC_DOCUMENT_SENDER_FSBA
      AC_DOCUMENT_SENDER_HRPAY
      AC_DOCUMENT_SENDER_TRAVL
      AC_DOCUMENT_SENDER_VBAK
      AC_DOCUMENT_SENDER_VBRK
      AC_DOCUMENT_SHKZG_CORRECT
      AC_PAYMENTBLOCK_CHECK
      AC_PAYMENTBLOCK_UPDATE
      AC_VALUATION_PRESENT
      BAPI_ACC_DOCUMENT_DISPLAY
      BAPI_ACC_DOCUMENT_RECORD
      FKK_AC_DOCUMENT_FICA,

      the T_ACCIT is not available and the dynamic assignment will result in a SY-SUBRC <> 0.

      If you use the field-symbol in this case, then it is not assigned (the more if the unnecessary UNASSIGN has been used) and you will get the dump.

      I'd assume that if T_ACCIT is not available you just do not need it.

      Please read your dump again to see that the dump does not occur with ASSIGN statement

      Regards,

      Clemens

  • avatar image
    Former Member
    Sep 14, 2010 at 11:44 AM

    Hi,

    Is T_ACCIT[] defined as a global field in the function group or is it a passed internal table into the function module on the call stack?

    If the latter, then you may need to consider looking further up the call stack to get the global internal table from the routine which calls the FM (or even higher in the call stack).

    Regards, Andy

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 14, 2010 at 12:35 PM

    Probably the original variable with the table disappears from the memory.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 15, 2010 at 05:11 AM
    data: c_accit(30) VALUE '(SAPLRWCL)T_ACCIT[]'.
    
    
    ASSIGN (c_accit) TO <fs_accit>.
    
    if sy-subrc eq 0.
    Normal program flow.
    else.
    Exception Handling/Exit Logic
    endif.
    
    Add comment
    10|10000 characters needed characters exceeded