cancel
Showing results for 
Search instead for 
Did you mean: 

defining screen fields using FIELD-SYMBOL

Former Member
0 Kudos

Hi..

I need to update a user field in co01. I ws able to get the material i wanted to display on the user field through this code.

DATA : material like CAUFVD-matnr.

FIELD-SYMBOLS: <F> TYPE CAUFVD-matnr.

assign ('(SAPLCOVF)CAUFVD-matnr') to <F>.

If SY-SUBRC = 0.

material = <F>.

endif.

now i want to assign this to

(SAPLCOVF)AFVGD-USR00 ..

The exact opposite of wht i do in the above code. But the problem is how do u define a screen field in FIELD-SYMBOL.

i tried

FIELD-SYMBOLS: <F1> LIKE SAPLCOVF(AFVGD-SLWID).

But tht doesn't work?? Cn anyone help pls? Tnx

Keshi

Accepted Solutions (1)

Accepted Solutions (1)

former_member181962
Active Contributor
0 Kudos

Try :

FIELD-SYMBOLS: <F1> type AFVGD-SLWID.

Former Member
0 Kudos

Hi.. Tnx for replying..

The problem when giving it like that is that its just another field symbol frm a structure, and not the exact screen field..

Just like i gt the value frm the screen by giving assign ('(SAPLCOVF)CAUFVD-matnr') to <F>, i want to now assign this value to another different field which is displayed in the CO01.

When i just assigned it to afvgd-slwid it wouldnt get updated on the screen.. Any idea??

Former Member
0 Kudos

Hi

If you want to transfer the value, u should transfer it to field-symbol:

assign (FIELDNAME1) to <F>.

If SY-SUBRC = 0.

material = <F>.

endif.

assign (FIELDNAME2) to <F>.

If SY-SUBRC = 0.

<F> = material.

endif.

Max

Former Member
0 Kudos

Thanks Max..

I finally feeel as if i'm getting somewhr with this..

But it still didn't work.. The exact code i wrote tnx to u ws,

DATA : material like CAUFVD-matnr,

USR00 LIKE AFVGD-USR00,

SLWID LIKE AFVGD-SLWID.

FIELD-SYMBOLS: <F> TYPE CAUFVD-matnr,

<F1> TYPE AFVGD-SLWID,

<F2> TYPE AFVGD-USR00.

DATA: FIELDNAME1(30) VALUE '(SAPLCOVF)CAUFVD-MATNR',

FIELDNAME2(30) VALUE '(SAPLCOVF)AFVGD-USR00',

FIELDNAME3(30) VALUE '(SAPLCOVF)AFVGD-SLWID'.

assign (FIELDNAME1) to <F>.

If SY-SUBRC = 0.

material = <F>.

endif.

assign (FIELDNAME3) to <F1>.

If SY-SUBRC = 0.

<F1> = '0000001'.

endif.

assign (FIELDNAME2) to <F2>.

If SY-SUBRC = 0.

<F2> = <F>.

endif.

whn i debugged the code, the values appeared for <F2> and <F1>, but it doesnt appear on the screen, when i checked with the transaction CO02.. The field that should have been updated, is still blank.. Any idea? Tnx a lot..

Former Member
0 Kudos

Hi

I suppose the code is working, but the problem is where that code is working, u should debug the std program after calling user-exit, probably the std program is replacing the value of that field.

In this case you can't use this solution.

Max

Former Member
0 Kudos

Tnx.. Max. tht gets written to another structure before the user exit, only that is displayed in the program..

So in the user exit a modification has to be made to the tht structure, named AFVGD_SAV..

I'm trying to do tht now.. Thnks a lot for all ur help..

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi

DATA : material like CAUFVD-matnr,

<b> USR00 LIKE AFVGD-USR00.</b>

<b>* FIELD-SYMBOLS: <F> TYPE CAUFVD-matnr.</b>

FIELD-SYMBOLS: <F> TYPE ANY.

DATA: FIELDNAME1(30) VALUE '(SAPLCOVF)CAUFVD-MATNR',

FIELDNAME2(30) VALUE '(SAPLCOVF)AFVGD-USR00'.

assign (FIELDNAME1) to <F>.

If SY-SUBRC = 0.

material = <F>.

endif.

assign (FIELDNAME2) to <F>.

If SY-SUBRC = 0.

USR00 = <F>.

endif.

Max