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: 

loop at screen

Former Member
0 Kudos

hi can u pls tell me how to loop at screen and read a value!! i want to loop at sapmv45b and read the value of rv45a-kfrel fro transaction va01 !!! and also i have done in my coding like i am throwing a warning message (that i have defined) but i am not able to go back and correct that mistake by pressing enter that message come repeatedly!! can u tell me a suitable solution!!

POINTS PROMISED AND THANX IN ADVANCE!!

6 REPLIES 6

Former Member
0 Kudos

hi,

chk out the foll code:

SELECTION-SCREEN BEGIN OF BLOCK process WITH FRAME TITLE text-001.

parameter: p_matnr like mara-matnr.

parameter: p_ernam like mara-ernam.

SELECTION-SCREEN END OF BLOCK process.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

if p_matnr is not initial.

select single ernam

from mara

into ernam

where matnr eq p_matnr.

endif.

MODIFY SCREEN.

ENDLOOP.

hope it solves your problem.

regards,

Navneeth.K

Former Member
0 Kudos

Hi,

Loop at screen.

IF Screen-name = 'MATNR'.

screen-value = '0'.

endif.

modify screen.

endloop.

Former Member
0 Kudos

if u r trying to use the subroutine <b>userexit_field_modification.</b> in the include program MV45AFZZ, this sample code might help u

FORM userexit_field_modification.

  • Greying out the Material, Quantity and UoM fields for COMBO sub-items

CHECK vbap-pstyv EQ 'ZTAE' OR " Sub-item Category for COMBO items

vbap-pstyv EQ 'ZRCI'. " Sub-item Category for Return Orders

IF screen-name = 'RV45A-MABNR' OR " Material

screen-name = 'RV45A-KWMENG' OR " Order quantity

screen-name = 'VBAP-VRKME' OR " Sales Unit

screen-name = 'VBEP-WMENG' OR " Order qty in Schedule Lines

screen-name = 'RV45A-KMPMG'. " Order quantity in "Structure" tab

SCREEN-INPUT = 0.

MODIFY SCREEN.

ENDIF. " IF screen-name = 'RV45A-...

ENDFORM

0 Kudos

i am usiing the exit userexit_move_field_to_vbak!! i want to loop at the screen sapmv45b to read the value of rv45a-kfrel to check if the header billing plan is checked!! one more thing when i cdheck for transaction va21 and va22 this rv45a has the value 'x' if the header billiong plan is cehcked but for transaction va01 and va02 this is always sapce even if the header billing plan is checked can u tell me how to do it!!!

0 Kudos

Hi

I don't believe you need to use the LOOP AT SCREEN statament to know the value of RV45A-KFREL: can't you read it directly?

Anyway try this:

FIELD-SYMBOLS: <FS> TYPE ANY.

LOOP AT SCREEN.
  IF SCREEN-NAME = 'RV45A-KFREL'.
     ASSIGN SCREEN-NAME TO <FS>.
  ENDIF.
ENDLOOP.

Max

Former Member
0 Kudos

you don't loop at screen to read a value...

if you want to read a value of a screen field then use the FM DYNP_VALUES_READ.

loop at screen is meant more to change the properties of screen elements at runtime. for example changing the visibility, to make a field enabled or disabled etc.

for reading a screen field value...you will have to use the function module DYNP_VALUES_READ.

in this fm you need to pass a table which has a structure of dynpread. fill in the fieldname and append to this table...after execution of this function module, the field "fieldvalue" will contain the value of the field specified in the field "fieldname".

regards,

Priyank