Skip to Content

Dynamic assignment of variable

Hello,

I am currently investigating a dump which was occuring in our productive system in one of our BTE's while doing rebates with T-Code VBOF:

The current ABAP program "SAPLV60A" had to be terminated because it has

come across a statement that unfortunately cannot be executed.

27 ASSIGN ('(SAPMV60A)XVBRK') TO <ls_vbrk>.

28 IF sy-subrc NE 0.

>>>>> ASSIGN ('(SAPLV60A)XVBRK') TO <ls_vbrk>. " Invoice creation in BG

30 IF sy-subrc NE 0.

31 RETURN.

32 ENDIF.

Anyone got an idea on why we are receiving a dump saying "Field symbol has not yet been assigned."?

I was expecting in case the assignment was not working correctly that sy-subrc would be set to 4 as it is happening in line 27.

Regards,

Dominik

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    Posted on Oct 01, 2014 at 11:40 AM
    • SAPLV60A is not active but was active (look in the "List of ABAP programs affected") and so XVBRK is no longer active (I suppose some FM of the group was called) -> Note that the documentation of this statement syntax mentions a "For internal use only,"
    • SAPMV60A wasn't active, so no problem arose.

    Regards,
    Raymond

    Add a comment
    10|10000 characters needed characters exceeded

    • But in a FM like RV_INVOICE_DOCUMENT_ADD, XVBRK is a parameter of the FM and not a data defined in the global area (TOP) if the main program (SAPLV60A) so cannot be assigned from another program, only "global data object" of the program are allowed. (Here XVBRK is defined in include VBRKDATA at start of program SDBONT06 so an assignment in this program should not dump)

      Regards,

      Raymond

  • author's profile photo Former Member
    Former Member
    Posted on Oct 01, 2014 at 08:50 AM

    Hi

    Yes it should work as you says:

    I've tried your code and it works as you expect....which is your basis release?

    Can you post the dump?

    Max

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 01, 2014 at 12:01 PM

    Hi,

    XVBRK is not globally defined in SAPLV60A, it is only an interface parameter of some function modules and only known there.

    If you need to access it, you have to define a globally defined internal table of same structure, which you can fill fill thru enhancement or userexit.

    Then you can access this new table with ASSIGN.

    Gruß

    Klaus

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 01, 2014 at 01:37 PM

    A suggestion

    If I understand what you need to do:

    You have developed a BTE triggered while FI document is beeing posted ....I've had a problem like yours, so I've developed the following code for a fm for BTE 1050

    DATA: MY_BSEG TYPE BSEG_T WITH HEADER LINE.

    LOOP AT T_BKPF.

    CLEAR MY_BSEG[].

    CLEAR MY_BSEG.

    LOOP AT T_BSEG INTO MY_BSEG

    WHERE BUKRS = T_BKPF-BUKRS

    AND BELNR = T_BKPF-BELNR

    AND GJAHR = T_BKPF-GJAHR.

    APPEND MY_BSEG.

    ENDLOOP.

    CALL FUNCTION 'Z_ACM_COMMISSION_CREATE_OPEN'

    EXPORTING

    I_BKPF = T_BKPF

    I_BSEG = MY_BSEG[]

    I_UPDATE_TASK = 'X'.

    ENDLOOP.

    My fm Z_ACM_COMMISSION_CREATE_OPEN belongs to a function group where I've defined other fms in order to get all data from billing, those fms are placed in the user-exit of the bill, like, for example, the user-exit of interface SD-FI

    So it doesn't need to use field-symbol

    Max

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.