Application Development 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: 

Using field symbols to clear structure CAUFVD

Former Member
0 Kudos

Hi,

I am using the following code to clear structure CAUFVD in the top include LIWOLTOP of the main program SAPLIWOL.

FIELD-SYMBOLS: <fs_caufvd> TYPE any .

CONSTANTS: c_caufvd(25) TYPE c VALUE '(SAPLIWOL)CAUFVD'.

ASSIGN (c_caufvd) TO <fs_caufvd>.

clear: <fs_caufvd>.

However I get a short-dump: 'GETWA_NOT_ASSIGNED' (Field symbol has not yet been assigned').

Could you please help with this issue.

Thanks.

1 ACCEPTED SOLUTION

ferry_lianto
Active Contributor
0 Kudos

Hi,

Try this.

FIELD-SYMBOLS: <fs_caufvd> TYPE any .

DATA: wa_struc(100) TYPE c,

wa_caufvd TYPE caufvd.

wa_struct = '(SAPLIWOL)CAUFVD'.

ASSIGN (wa_caufvd) TO <fs_caufvd>.

wa_caufvd = <fs_caufvd>.

clear wa_caufvd.

<fs_caufvd> = wa_caufvd

UNASSIGN <fs_caufvd>.

Regards,

Ferry Lianto

8 REPLIES 8

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Hi, you code look ok, but in order for it to work, it must be in the right place. Where are you inserting this code? In debug mode, make sure that the program SAPLIWOL is in the call stack.

Regards,

Rich Heilman

0 Kudos

Hi,

Yes, SAPLIWOL is in the call stack. My problem is this. I am using a bapi IQS4_CREATE_NOTIFICATION to create a notification. There is a call to the function module IWOL_ADD_NOTIF_TO_DDB_INT within this bapi and the issue is that the previous value of structure CAUFVD is being retained within this function module. I am trying to clear this value using the code indicated above.

My call stack is indicated below:

<b>SAPLIWOL FUNCTION IWOL_ADD_NOTIF_TO_DDB_INT</b>

SAPLIQS0 FORM ZUORDNEN_ORDER_F01

SAPLIQS4 FORM CREATE_NOTIFCATION_HEADER_F10

SAPLIQS4 FUNCTION IQS4_CREATE_NOTIFICATION

ZCL_20_BC_QM_NOTIF============CP METHOD CREATE_NOTIF

Thanks.

0 Kudos

Are you calling the function module IQS4_CREATE_NOTIFICATION directly from some custom program.

Regards,

Rich Heilman

0 Kudos

Yes, I am calling this bapi from a custom transaction.

Thank you.

0 Kudos

I think that you might want to use the BAPI BAPI_SERVNOT_CREATE instead to make sure that all of the bases are covered.

Regards,

Rich Heilman

0 Kudos

Thank you Rich for your valuable advice. I was having certain other issues while using field symbols and finally resorted to a leave to transaction call to clear all the variables after returning from the bapi.

ferry_lianto
Active Contributor
0 Kudos

Hi,

Try this.

FIELD-SYMBOLS: <fs_caufvd> TYPE any .

DATA: wa_struc(100) TYPE c,

wa_caufvd TYPE caufvd.

wa_struct = '(SAPLIWOL)CAUFVD'.

ASSIGN (wa_caufvd) TO <fs_caufvd>.

wa_caufvd = <fs_caufvd>.

clear wa_caufvd.

<fs_caufvd> = wa_caufvd

UNASSIGN <fs_caufvd>.

Regards,

Ferry Lianto

0 Kudos

Hi,

Thanks for the code snippet. This did work for me. However, I was having other issues while calling the bapi from my custom transaction and therefore resorted to a leave to transaction call to resolve the issue of certain variables not being cleared.

Regards,

Tessy