Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Runtime error GETWA_NOT_ASSIGNED has occurred

Former Member
0 Likes
10,636

There is a dump error for this code, Can anyone pls help me ??



FIELD-SYMBOLS : <fs1> TYPE any ,
                   <fs2> TYPE any .
   RANGES : tb_set FOR reguh-laufi.
   DATA : BEGIN OF tb_setleaf OCCURS 0.
           INCLUDE STRUCTURE setleaf.
   DATA : END OF tb_setleaf.

   CLEAR w_pay.

   SELECT * FROM setleaf INTO CORRESPONDING FIELDS OF TABLE tb_setleaf
   WHERE setname = 'ALC_FI_CYCLE_ID'.

   IF sy-subrc EQ 0.
     LOOP AT tb_setleaf.
       MOVE tb_setleaf-valsign  TO tb_set-sign.
       MOVE tb_setleaf-valoption   TO  tb_set-option.
       MOVE tb_setleaf-valfrom  TO tb_set-low.
       MOVE tb_setleaf-valto    TO tb_set-high.
       APPEND tb_set.
       IF bkpf-bktxt CS tb_set-low.
         MOVE 'X' TO w_pay.
       ENDIF.
     ENDLOOP .

     CHECK w_pay EQ 'X'.
** recup nom du cycle
     ASSIGN '(SAPF110S)REGUV-LAUFI' TO <fs1>.
     ASSIGN (<fs1>) TO <fs2>.
     w_laufi = <fs2> .
     UNASSIGN : <fs1>, <fs2>.

     IF w_laufi IN tb_set.

** recuperation date de base
       ASSIGN '(SAPF110S)REGUP-ZFBDT' TO <fs1>.
       ASSIGN (<fs1>) TO <fs2>.
       w_zfbdt = <fs2>.
       UNASSIGN : <fs1>, <fs2>.

** recuperation condition de paiement
       ASSIGN '(SAPF110S)REGUP-ZTERM' TO <fs1>.
       ASSIGN (<fs1>) TO <fs2>.
       w_zterm = <fs2>.
       UNASSIGN : <fs1>, <fs2>.


** calcul date d'échéance

1 ACCEPTED SOLUTION
Read only

former_member201275
Active Contributor
0 Likes
6,589

Do this:

If <fs2> is assigned.

w_laufi = <fs2> .

endif.

There is a dump error for this code, Can anyone pls help me ??



FIELD-SYMBOLS : <fs1> TYPE any ,
                   <fs2> TYPE any .
   RANGES : tb_set FOR reguh-laufi.
   DATA : BEGIN OF tb_setleaf OCCURS 0.
           INCLUDE STRUCTURE setleaf.
   DATA : END OF tb_setleaf.

   CLEAR w_pay.

   SELECT * FROM setleaf INTO CORRESPONDING FIELDS OF TABLE tb_setleaf
   WHERE setname = 'ALC_FI_CYCLE_ID'.

   IF sy-subrc EQ 0.
     LOOP AT tb_setleaf.
       MOVE tb_setleaf-valsign  TO tb_set-sign.
       MOVE tb_setleaf-valoption   TO  tb_set-option.
       MOVE tb_setleaf-valfrom  TO tb_set-low.
       MOVE tb_setleaf-valto    TO tb_set-high.
       APPEND tb_set.
       IF bkpf-bktxt CS tb_set-low.
         MOVE 'X' TO w_pay.
       ENDIF.
     ENDLOOP .

     CHECK w_pay EQ 'X'.
** recup nom du cycle
     ASSIGN '(SAPF110S)REGUV-LAUFI' TO <fs1>.
     ASSIGN (<fs1>) TO <fs2>.
     w_laufi = <fs2> .
     UNASSIGN : <fs1>, <fs2>.

     IF w_laufi IN tb_set.

** recuperation date de base
       ASSIGN '(SAPF110S)REGUP-ZFBDT' TO <fs1>.
       ASSIGN (<fs1>) TO <fs2>.
       w_zfbdt = <fs2>.
       UNASSIGN : <fs1>, <fs2>.

** recuperation condition de paiement
       ASSIGN '(SAPF110S)REGUP-ZTERM' TO <fs1>.
       ASSIGN (<fs1>) TO <fs2>.
       w_zterm = <fs2>.
       UNASSIGN : <fs1>, <fs2>.


** calcul date d'échéance

8 REPLIES 8
Read only

Former Member
0 Likes
6,589

hi giri,

have you debugged and checked that

which part of the code is causing this error?

Read only

0 Likes
6,589

ya its in this part

w_laufi = <fs2> .

Read only

0 Likes
6,589

No,

it's in this part:

  ASSIGN '(SAPF110S)REGUV-LAUFI' TO <fs1>.

ASSIGN (<fs1>) TO <fs2>.

Why do you assume, that REGUV-LAUFI (which is an identifyer for a payment-run)

can be used as a memory handle?

Because this is what you attempt to do. You take whatever value REGUV-LAUFI has in program SAPF110S and try to access a memory-area (variable) named like that.

The least you can do is, to make certain that your field-symbol is assigned. The error you get is, because it is not assigned, is because your attempted assignment did not succeed.

Check in debug-mode, what the actual value of <fs1> is at that time and then ask yourself, if there is any variable named like that.

Best regards - Jörg

Read only

Former Member
0 Likes
6,589

Hi Giri,

The problem occurs at here, ASSIGN (<fs1>) TO <fs2>.    <fs2> is still not assigned.

If you want use this grammar, assign ('(program1)fieldName') to <fs>, you must make sure the current program and program1 is under same 'call stack'. You can check 'call stack' in debugging view.


regards,

Archer.

Read only

former_member201275
Active Contributor
0 Likes
6,590

Do this:

If <fs2> is assigned.

w_laufi = <fs2> .

endif.

Read only

0 Likes
6,589

Thanks all,

But how to assign <fs2>

Thanks & Regards

Giri

Read only

jrg_wulf
Active Contributor
0 Likes
6,589

I just reread your coding.

just skip the line ASSIGN (<fs1>) TO <fs2>.

You want to have the values, that are already (if successfull) accessible in <fs1>

So use them.

Your code would look like this then:

ASSIGN (SAPF110S)REGUV-LAUFI TO <fs1>

IF <fs1> IS ASSIGNED.

  w_laufi = <fs1>.

ENDIF.

The same is true for the next two assignments for ZFBDT and ZTERM.

They too don't get better with a second assignment.

Keep in mind that by using the brackets, you dereferenciate the field. That is, instead of the memory-area, which is assigned to <fs1>, you attempt to find a different memory area NAMED like the current value of <fs1>. That will not work in your setting.

BR - Jörg

Read only

Former Member
0 Likes
6,589

Hi,

To fix this dump, you can read SAPNOTE 0002730043.
Implementing the note should fix that dump.

If you dont know how to implemente a Sap note, check this link https://blogs.sap.com/2013/06/26/how-to-implement-sap-note-in-snote/

Best regards,

Horacio Nhacuonga