2010 Aug 30 1:55 PM
Hi SAP guru's.
I have one query regarding validation of internal table.
In my requirement i am having one internal table with filelds MBRSH, MTART< WERKS VKORG,VKTWEG with Corresponding check tables T137, T134, T001W,TVKO. TVTW.
I need to validate these fields.If any of these record got failed in dont want that fields in my final internal Table.i.e Suppose for one record MTART got failed i dnt want the corresponding records for MBRSH,WERKS,VKORG,VTWEG.
Please help me with the sample code..
Will really appreciate your help.
Thanks
Simran.
Hi SAP guru's.
I have one query regarding validation of internal table.
In my requirement i am having one internal table with filelds MBRSH, MTART< WERKS VKORG,VKTWEG with Corresponding check tables T137, T134, T001W,TVKO. TVTW.
I need to validate these fields.If any of these record got failed in dont want that fields in my final internal Table.i.e Suppose for one record MTART got failed i dnt want the corresponding records for MBRSH,WERKS,VKORG,VTWEG.
Please help me with the sample code..
Will really appreciate your help.
Thanks
Simran.
2010 Sep 06 1:12 PM
Hi,
Let's say it_tab1 is your internal table and you have to pass the valid records into it_tab2.
let say wa_tab1 & wa_tab2 are respective work area's for the above.
Data :flag(1) type c.
Loop at it_tab1 into wa_tab1.
IF(failure condition to validate mbrsh).
flag ='x'.
endif.
like this write validations for all fields.
at end of row.
if not flag = 'x'.
move wa_tab1 to wa_tab2.
append wa_tab2 to it_tab2.
endif.
endat.
clear :flag,wa_tab1,wa_tab2.
endloop.
regards,
viswa.
2010 Sep 06 1:27 PM
Hi,
You have internal table, ITAB1 which has all the records,
Do the following
Loop at ITAB1 into WA_TAB1,
validation for MBRSH
if sy-subrc NE 0.
CONTINUE.
Endif.
validation for MTART
if sy-subrc NE 0.
CONTINUE.
Endif.
_
_
_
_
Do the same thing for all fields
Finally
APPEND WA_ITAB1 to ITAB2.
Endloop.
Regards,
Selva