Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to do validation in LSMW

Former Member
0 Kudos
728

Hi all,

Can anybody help to validate the material in LSMW. My scenario is as follows:

Validation should be: This is to upload material. While uploading I should validate the material number. whether the material number is started with Z or not. If not, then that row should ignore and process further records.

that is i should process only those records which are started with Z.

I doubt whether this type of validation is possible to do in LSMW or not? If possible pls send me the process.

Awaiting for your valuable inputs and suggestions.

Thanks

Rgds,

Sudhakar

1 ACCEPTED SOLUTION

Former Member
0 Kudos
220

goto the SETP: field mapping & conversion rules ;

here,

double click on MATNR field.

now you will be able to see an abap editor.

here you have to write the logic for that.

IF INPUTFILE-MATNR+0(1) <> 'Z'.

SKIP_RECORD. "This will SKIP the current record,if the first character of MATNR is not Z.

ELSE.

CONDENSE INPUTFILE-MATNR.

BMM00-MATNR = INPUTFILE-MATNR.

ENDIF.

Message was edited by: Srikanth Kidambi

6 REPLIES 6

Former Member
0 Kudos
221

goto the SETP: field mapping & conversion rules ;

here,

double click on MATNR field.

now you will be able to see an abap editor.

here you have to write the logic for that.

IF INPUTFILE-MATNR+0(1) <> 'Z'.

SKIP_RECORD. "This will SKIP the current record,if the first character of MATNR is not Z.

ELSE.

CONDENSE INPUTFILE-MATNR.

BMM00-MATNR = INPUTFILE-MATNR.

ENDIF.

Message was edited by: Srikanth Kidambi

0 Kudos
220

Hi Srikanth,

Thats very help full answer to me. Thanks a lot.

Can we can validate the material by using some function module(customized function module) in that editor. I mean, will this editor allow us to validate as we do in normal editor(se38).

Now my problem will gets solved based on ur answer.

Thanks and waiting for your reply.

Rgds,

Sudhakar

0 Kudos
220

yes sudhakara,

you can call any function modules here and based on the result,you can either choose to proceed or even you can SKIP that record.

just use SKIP_RECORD to skip that record and process with the next record.

you might have observed,when you double click on that field,you will see an line based editor,which is nothing but your ABAP editor. you can write any abap code related to that field.

further info:

to get more idea about this, goto DISPLAY CONVERSION program/Display READ program.you will a system generated ABAP program,which is included your added code here.

(if the above menu options are not visibile by default to you, then select USER MENU button from the application tool bar and select these checkboxes)

hope you got this.

if your problem is solved,Pl close the thread.

check these links for LSMW,these documents are very useful,go thru them once,if you have time.

http://www.scmexpertonline.com/downloads/SCM_LSMW_StepsOnWeb.doc

Regards

srikanth

Message was edited by: Srikanth Kidambi

0 Kudos
220

Hi Srikanth,

Thanks a lot again for your valuable suggestion.

It should work for my scenario.

Rgds,

Sudhakar

Former Member
0 Kudos
220

Hi,

In LSMW Select the step, view source code, double click on that step it takes you to ABAP editor, click on the change button(CTRL+F1) and add your validation Logic there, hope this answer is also helpfull for you.

Regards:-

Santosh

0 Kudos
220

Hi Santhosh,

Its a helpful suggestion to me. Thanks a lot.

Looking forward for your support.

Rgds,

Sudhakar