This website is not affiliated with, sponsored by, or approved by SAP AG.

Skip field during batch input in LSMW

Development (ABAP Development WorkBench, ABAP/4 programming)

Moderators: Snowy, thx4allthefish, YuriT, Gothmog

Skip field during batch input in LSMW

Postby evangelina » Mon Jan 19, 2015 3:36 am

Hello ABAP gurus!

I need your help on an LSMW recording. I’m in a project where we have to migrate thousands of customer and vendor items from the old system to SAP.

Let’s take the customers’ items as example. I’m using batch input recording as an input technique. I’ve created a recording by using an invoice transaction as a model. When I run a test with some hundreds of items, I found that for invoices (posting key 01) the batch input was running ok but for other transactions (e.g. payments, other clearings etc.) the batch stopped because “Field BSEG-ZTERM. does not exist in the screen SAPMF05A 0301”. The reason is obvious. Field BSEG-ZTERM is missing from transactions other than invoices and the system stops. Fortunately, it is not an error message and by hitting ENTER the process continues until the next non invoice transaction. However, when dealing with thousands of items, hitting enter every time the system stops is not a solution.

So, I wonder if it is possible to put some ABAP code somewhere in the field mapping or conversion rules in order to “tell” the system that if field BSEG-ZTERM exists in the screen then fill it, if it is not in the screen then skip it and continue with next filed. Please note that I only want to skip the field, not the record. Is this possible?

Thanks in advance!
evangelina
 
Posts: 24
Joined: Mon Jul 31, 2006 7:55 am

Re: Skip field during batch input in LSMW

Postby Gothmog » Mon Jan 19, 2015 7:57 am

Well, yes, you can change the mapping coding to only map for certain cases.
Just double-click on the field mapping, and modify the code according to your rules.
The field should keep the nodata value, and your batch input should work.

If that doesn't work, you could have several recordings, and only do the transfer_record for the relevant one.
68 74 74 70 3a 2f 2f 74 69 6e 79 75 72 6c 2e 63 6f 6d 2f 62 64 6f 37 6d 77 67
Gothmog
 
Posts: 1941
Joined: Wed Sep 12, 2007 4:46 am
Location: Probably not home

Re: Skip field during batch input in LSMW

Postby evangelina » Tue Jan 20, 2015 2:53 am

Gothmog wrote:Well, yes, you can change the mapping coding to only map for certain cases.
Just double-click on the field mapping, and modify the code according to your rules.
The field should keep the nodata value, and your batch input should work.

If that doesn't work, you could have several recordings, and only do the transfer_record for the relevant one.


Thanks for your answer!
I want to avoid several recordings because we will totally loose control. The solution should be applied on recordings for customers, vendors and GL accounts. The problem is that I don't have access to ABAP developer.

The rule appears as shown below:

Source: ARITEMS-PAYMENT_TERMS (PAYMENT TERMS)
Rule : Transfer (MOVE)
Code: ARITMS-ZTERM = ARITEMS-PAYMENT_TERMS.


Source is the relevant field from text file. In the code section says "fill recording field ARITMS-ZTERM with whatever is found in text source field".

Can you suggest a sample code to skip this transfer if field ARITMS-ZTERM is not available?

Thanks in advance!
evangelina
 
Posts: 24
Joined: Mon Jul 31, 2006 7:55 am

Re: Skip field during batch input in LSMW

Postby Gothmog » Tue Jan 20, 2015 4:41 am

Something like:
Code: Select all
IF (condition).
  ARITMS-ZTERM = ARITEMS-PAYMENT_TERMS.
ENDIF.
68 74 74 70 3a 2f 2f 74 69 6e 79 75 72 6c 2e 63 6f 6d 2f 62 64 6f 37 6d 77 67
Gothmog
 
Posts: 1941
Joined: Wed Sep 12, 2007 4:46 am
Location: Probably not home

Re: Skip field during batch input in LSMW

Postby evangelina » Wed Jan 21, 2015 7:51 am

Gothmog wrote:Something like:
Code: Select all
IF (condition).
  ARITMS-ZTERM = ARITEMS-PAYMENT_TERMS.
ENDIF.


Thanks for your suggestion. I'll try it.
evangelina
 
Posts: 24
Joined: Mon Jul 31, 2006 7:55 am


Return to ABAP

Who is online

Users browsing this forum: No registered users and 4 guests



cron


loading...


This website is not affiliated with, sponsored by, or approved by SAP AG.