06-25-2007 11:08 AM
Dear ALL,
We have added a new field to the existing transaction using a screen exit and provided the screen field with some validations.
When ever the user enter a rong value its throwing a message and coming back to the same screen... and the value in that particular field is getting erased.
i want the field value to be present , so that user can correct it.
can any body pls advice..
Regards,
Sandeep.
06-25-2007 11:11 AM
hi,
try to hold that value in a variable before throwing a message in PAI event, then in the pbo event replace the value of that field with the value of this variable.
regards,
Navneeth K.
06-25-2007 11:11 AM
hi,
try to hold that value in a variable before throwing a message in PAI event, then in the pbo event replace the value of that field with the value of this variable.
regards,
Navneeth K.
06-25-2007 11:12 AM
hi,
while validating i think ur giving error message and clearing it. check the field and give wronging message or information mesaage n dont erase or clear the field.
if helpful reward some points,
with regards,
suresh.
06-25-2007 11:15 AM
hi,
this validation u can do chain and endchain,
ex code is as below.
chain.
field po_details-matnr.
field po_details-plant.
field po_details-sloc.
field po_details-mat_group.
field po_details-po_quantity.
field po_details-or_unit.
field po_details-netpr.
module chain_handle_fields3 on chain-request.
endchain.
"and module
module chain_handle_fields3 input.
data: l_matnr type matnr.
select single matnr from mseg into l_matnr where matnr eq po_details-matnr.
move: l_matnr to g_po_details-matnr.
if sy-subrc ne 0.
clear: l_matnr, g_po_details.
message e011(zct).
exit.
endif.
clear l_matnr.
data: l_uom type meins.
select single meins from mara into l_uom where meins eq po_details-or_unit.
move l_uom to g_po_details-or_unit.
if sy-subrc ne 0.
clear: l_uom, g_po_details.
message e013(zct).
exit.
endif.
clear l_uom.
data: l_plant type werks_d.
select single werks from mseg into l_plant where werks eq po_details-plant
and matnr eq po_details-matnr.
move: l_plant to g_po_details-plant.
if sy-subrc ne 0.
clear: l_plant, g_po_details.
message e009(zct).
exit.
endif.
clear l_plant.
data: l_sloc type lgort_d.
select single lgort from mseg into l_sloc where werks eq po_details-plant
and matnr eq po_details-matnr
and lgort eq po_details-sloc.
IF sy-subrc NE 0.
CLEAR: l_sloc, g_po_details.
MESSAGE e010(zct).
EXIT.
ENDIF.
move: l_sloc to g_po_details-sloc.
SORT g_po_details.
DELETE g_po_details WHERE matnr EQ ''.
IF NOT g_po_details[] IS INITIAL.
MODIFY g_po_details TRANSPORTING matnr plant sloc WHERE matnr EQ po_details-matnr.
ELSE.
move: po_details-mat_group to g_po_details-mat_group.
if po_details-po_quantity le 0.
message e015(zct).
else.
move:po_details-po_quantity to g_po_details-po_quantity.
endif.
IF po_details-netpr EQ ''.
MESSAGE e012(zct).
ELSE.
move po_details-netpr to g_po_details-netpr.
ENDIF.
move po_details-or_unit to g_po_details-or_unit.
on change of g_po_details-matnr.
append g_po_details.
else.
modify g_po_details index sy-tabix.
endon.
ENDIF.
clear: l_sloc, g_po_details.
endmodule. " chain_handle_fields3 INPUT
reward points if useful,
regards,
seshu.