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: 

LSMW -FB50 Transaction issue

Former Member
0 Kudos

I am using standard FB50 transaction for loading transaction data into R/3.I have to read the file

If the GL account is < 4000

I don't need to update the costcenter field and

else

GL account is > 4000 I have to populate value for costcenter field.

How can I do this.

2 REPLIES 2

vinod_gunaware2
Active Contributor
0 Kudos

Hi

U can code in LSMW in below two step.

Maintain field mapping and conversion rules

Maintain fixed values, translations, user-defined routines

Hope it will be useful.

regards

vinods

vinod_gunaware2
Active Contributor
0 Kudos

<b><b>Determine the Transaction Code at Runtime</b>Situation:</b> You want to transfer data a part of which has already been created in the system. You want to decide at runtime whether the data is created or changed.

<b>Example:</b> Customer master

Solution: Insert under "Global Data":

TABLES: KNA1.

Add the following coding for field BKN00-TCODE:

Select count(*) from kna1 where kunnr = <alte_kundennummer>.

if sy-dbcnt = 0.

bkn00-tcode = 'XD01'.

else.

bkn00-tcode = 'XD02'.

endif.

<b>Skip a Record</b>

<b>Situation:</b> You want to "skip" a record depending on a certain condition, i.e. this record shall not be converted and transferred to the output file

Solution:

if <condition>.

skip_record.

endif.

<b>Skip All Records of a Transaction</b>

<b>Situation:</b> You want to "skip" all records of a transaction depending on a certain condition.

Solution:

if <condition>.

skip_transaction.

endif.

regards

vinod