04-27-2007 7:39 AM
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!!
04-27-2007 7:42 AM
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
04-27-2007 7:44 AM
Hi,
Loop at screen.
IF Screen-name = 'MATNR'.
screen-value = '0'.
endif.
modify screen.
endloop.
04-27-2007 7:44 AM
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
04-27-2007 7:50 AM
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!!!
04-27-2007 8:04 AM
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
04-27-2007 7:45 AM
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