09-19-2005 1:08 PM
Hi,
I am having Material and serial number in the table control.Material is in enable mode and serial number in
disable mode.After entering material number I am checking whether it is serialized or not,if it is serialized I am enabling serial number field so that user can enter serial number(IN pbo).After entering the
serial number,the serial number field disabling automatically,my problme is that I need to check whether
the Material number and serial number combo already exists,if it is alrerady exists I need to raise the error message and also user able to change the serial number field(but it is disable after user entering the value).
09-19-2005 1:14 PM
Hi,
After checking the combo of Material number and serial number (which happens in PAI), set some flag if it already exits, raise error and in PBO that is called now,(after this PAI), check the flag and change the screen attributes for the serial number field as required. (loop at Screen -- modify -- endloop).
This should work. Anyway, would be glad to know
Regards
Aadarsh
Message was edited by: Aadarsh K
09-19-2005 1:18 PM
Hi,
Actually you should check and give the error message in PAI itself on CHAIN-REQUEST of these two fields, thus by preventing it from going into PBO.
ON CHAIN-REQUEST will keep the two fields enabled as long as the error is not resolved.
Hope this helps..
Sri
09-19-2005 2:15 PM
Hi sri,
Here the code I am using,it is giving error message,but after giving error message it is not allowing to change
the serial number or material.
DATA: N TYPE I,
count type i.
DESCRIBE TABLE i_z50_wty_zw_items LINES N.
read table i_z50_wty_zw_items into itab_wa index n.
" last record which you entered recently
count = 0.
loop at i_z50_wty_zw_items.
if i_z50_wty_zw_items-matnr = itab_wa-matnr and
i_z50_wty_zw_items-serialno = itab_wa-serialno.
if not ( i_z50_wty_zw_items-matnr is initial ) AND NOT
( i_z50_wty_zw_items-serialno is initial ).
count = count + 1.
endif.
endif.
endloop.
if count >= 1.
message e005(zpm) with text-528.
endif.
clear : count,
itab_wa.
09-19-2005 2:21 PM
Hi,
I am assuming that this code gets executed in a PAI Module. So please use,
CHAIN.
FIELD: <Your MATNR> field,
<Your Serial Number> field.
MODULE <Your PAI Module> ON CHAIN-REQUEST.
ENDCHAIN.
The error message should be inside this PAI Module.
This actually enables both the fields for editing after the error message.
Hope this helps..
Sri
09-19-2005 2:23 PM
Also the checks should be done inside the loop for the table control itself and not after the loop on the table control.
09-19-2005 2:27 PM
Also I would suggest you use some what similar logic as below,
loop at i_z50_wty_zw_items
WHERE matnr = <your tc structure>-matnr
and serialno = <your tc structure>-serialno.
if sy-tabix NE <your tc name>-current_line.
****Your error message here.
endif.
endloop.
This check should be done inside the table control loop in PAI.
I hope I am not confusing with all this..but this is the way the checks should be coded..
Message was edited by: Srikanth Pinnamaneni
09-20-2005 7:25 AM
Hi sri,
Here my tc structure is same as internal table i_z50_wty_zw_items.I used your logic within the loop
but its not working in my case.
09-20-2005 8:24 AM