2009 Dec 03 11:59 AM
Hi All,
I have to validate two fields which will be coming from Data upload file.To acheive this i have maintained the translations and in control data I have uploaed all the possible values.
Now my requirement is that in step no 5 if I have to check values only against the uploaded values else throw an error msg.I am not able to find how to write the logic for the same.
Pls let me know if require more details.
Thnx,
Rag
Hi All,
I have to validate two fields which will be coming from Data upload file.To acheive this i have maintained the translations and in control data I have uploaed all the possible values.
Now my requirement is that in step no 5 if I have to check values only against the uploaded values else throw an error msg.I am not able to find how to write the logic for the same.
Pls let me know if require more details.
Thnx,
Rag
2009 Dec 03 12:09 PM
hello raghav ,
In the step number 5 in LSMW you can keep checks for all the fields in the Source fields.
that is write code line in Mapping and conversion rule that if the field is empty in the file uploaded then raise an error message.
for suppose ur file structure as ,x,y,z fileds then check if filename-x is initial. raise message.
Regards,
Vachana.
2009 Dec 03 12:18 PM
It will be ok if I want to chk if coming values are empty or not.But in case of wrong values,How can we check ? I hope U got my pt?
Thnx
Rag
2009 Dec 03 2:10 PM
you can do this with a bit ABAP coding in step 5
double click the coding line and the ABAP editor is opening, here you can add any ABAP code you want to check whatever you need.
2009 Dec 03 2:21 PM
If the check fails, you can use a simple WRITE statement to issue the error message, and also make sure you skip the record or transaction using "skip_record" or "skip_transaction", whatever applies.
You can get fancy by collecting messages into internal tables and issue as ALV in the end, or use standard application log functions in group SBAL.
Thomas
2009 Dec 03 2:20 PM
For this you need to write below example logic in Step 5.
these two are wa_errortab and g_error_tab free defined from SAP.
IF NOT ymain_data-kunnr IS INITIAL.
SELECT SINGLE kunnr FROM kna1 INTO gv_kunnr
WHERE kunnr = ymain_data-kunnr.
IF sy-subrc EQ 0.
wa_errortab-msgty = gc_error.
wa_errortab-id = gc_msgclass.
wa_errortab-msgno = gc_msgno.
wa_errortab-par1 = ymain_data-kunnr.
wa_errortab-par3 = ymain_data-vtweg.
wa_errortab-par4 = ymain_data-spart.
INSERT wa_errortab INTO TABLE g_error_tab.
CLEAR wa_errortab.
skip_record. " Skips only structure but not entire record
skip_transaction. " Skips entire record
ELSE.
bkn00-kunnr = ymain_data-kunnr.
ENDIF.
2009 Dec 09 5:58 PM
2010 Apr 15 8:31 AM
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |