Application Development and Automation 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: 
Read only

lsmw coding point

Former Member
0 Likes
660

Hi Friends,

when i am doing lsmw to uploading the data..

it is compulsory to write the Code???

if we want to write the code..how to write? how to write the conditions???

can any one give one example??

regards,

Vijay.

3 REPLIES 3
Read only

Former Member
0 Likes
553

Hi Vijay,

Its not always compulsory to write coding in lsmw. You have to write coding when we have to introduce some conditions on the data being uploaded. You can put the code in the "Maintain field mapping and conversion" section.

Also look at these discussions.

Regards

Aneesh.

Read only

Former Member
0 Likes
553

Hi Vijay,

Remember these points while doing LSMW.

Below these coding u have to do in 5th step(Mapping)

if u dont have any code to write atleast u have to pass the / symbol in case for that particular field which there is no value.

instead of these source structure and target structure,

specify what ur using.

For EG:AS91_ZTABLE-ANLKL (source field) ,,

BALTD-ANLKL(target field).

************

1) this code u have to write for every field .

IF NOT AS91_ZTABLE-ANLKL IS INITIAL.

BALTD-ANLKL = AS91_ZTABLE-ANLKL.

ELSE.

BALTD-ANLKL = '/'.

ENDIF.

its better to upload the date formate like yyyymmdd.

but in our system we dont have this kind of formates so better to choose yyyy.mm.dd and do change ur date format in flat file itself in the above format(yyyymmdd).

if u dont want to change in the flat file , just rite ur code in LSMW itself ,

for this u have to write coding in Mapping(5th step) .

go to the particular field in change mode and double click on that field there u have to write like this.

2) like this u have write for the date fields.

For Eg:

if not as91_ztable-AKTIV is initial.

replace '.' with '' into as91_ztable-AKTIV.

replace '.' with '' into as91_ztable-AKTIV.

condense as91_ztable-AKTIV no-gaps.

BALTD-AKTIV = AS91_ZTABLE-AKTIV.

else.

baltd-aktiv = '/'.

endif.

If u perfectly know there is the value for every field then no need to write this code (if u write also there is no problem).

Kindly know if anything else u want anything

Reward points if helpful.

Thanks

Naveen khan

Message was edited by:

Pattan Naveen

Message was edited by:

Pattan Naveen

Read only

0 Likes
553

Hi naveen

I am uploading vendor master data using LSMW ,AND USING TCODE XK01 ,

the data in the file is different,

the data is in the format like 'first national bank' i want the data in 3 letter like "std" ,

can u pls provide me the coding in lsmw

thanks in advance

srinu