‎2008 Apr 04 3:08 PM
In my input screen am using lifnr field as mandatory.I have to enter range of vendors.In that if only one vendor is invalid it must error out only the particular vendor.Any idea to code?
‎2008 Apr 04 3:17 PM
One way is to select LFA1 using the select option LIFNR and deleting the invalid ones. If the delete is successful then inform the user that invalid vendors have been deleted.
Psuedo code...
select-options: P_LIFNR for LFA1-LIFNR.
select * from LFA1
into table I_VENDOR_VALIDATED
where LIFNR in P_LIFNR.
loop at I_VENDOR_VALIDATE.
"Delete invalid vendors - mark variable or issue 'E' message here...
endloop.
"If variable marked, Inform user if some vendors in range had been deleted.
MESSAGE 'Some vendors deleted' TYPE 'I'.
"Use I_VENDOR_VALIDATED for further processing
‎2008 Apr 04 3:13 PM
Hi,
You can do as below:
select single lifnr from lfa1 where lifnr in so_lifnr.
if sy-subrc NE 0.
message I000.
endif.
endselect.
Thanks,
Sriram Ponna.
‎2008 Apr 04 3:17 PM
One way is to select LFA1 using the select option LIFNR and deleting the invalid ones. If the delete is successful then inform the user that invalid vendors have been deleted.
Psuedo code...
select-options: P_LIFNR for LFA1-LIFNR.
select * from LFA1
into table I_VENDOR_VALIDATED
where LIFNR in P_LIFNR.
loop at I_VENDOR_VALIDATE.
"Delete invalid vendors - mark variable or issue 'E' message here...
endloop.
"If variable marked, Inform user if some vendors in range had been deleted.
MESSAGE 'Some vendors deleted' TYPE 'I'.
"Use I_VENDOR_VALIDATED for further processing
‎2008 Apr 05 4:49 AM
Hi what should i declare in the looping part am not clear in that
‎2008 Apr 05 4:57 AM
I dont think u need any looping what u need is u must validate low and high of select-options
‎2008 Apr 05 4:59 AM
‎2008 Apr 05 5:12 AM
It may help you
select-options: lifnr for lfa1-lifnr obligatory.
at selection-screen.
if lifnr[] is initial.
"write select statement to get only valid lifnr
elseif not lifnr[] is initial.
"write select statement and filter out the invalid lifnr.
endif.
‎2008 Apr 05 5:25 AM
Hi am new to ABAP so help me .I have written the code as
if lifnr[] is initial.
select single lifnr into gw_lfb1 from lfb1 where lifnr in s_lifnr.
elseif not lifnr[] is initial.
wat should i write in the else if part?I must also show the particular vendor is invalid.
‎2008 Apr 05 6:00 AM
Try this code and tell me whether it works for u or not
tables: lfb1.
data: itab like lfb1 occurs0.
at selection-screen.
select-options: p_lifnr for lfa1-lifnr obligatory.
select lifnr from lfb1 into table itab.
loop at itab.
select single * from itab where lifnr in p_lifnr.
if sy-subrc ne 0.
delete from itab.
write:/ 'invalid vendor', itab-lifnr.
endif.
endloop
‎2008 Apr 05 7:14 AM
Hi i have one more doubt regarding using a function module.I have to generate a report in that it must show Error Message: For multiple errors on a single iDoc, multiple records should be shown. i have to use the FM YAPR_CHECK_INVOICE_FOR_ERRORS i have read all the status of idoc using idoc_read_completely.Do u have idea to use the first FM?