99851920-lsmw-with-rfbibl00.pdf

14
Generated by Jive on 2012-06-11+02:00 1 naimesh.patel: LSMW with RFBIBL00 Posted by Naimesh Patel Aug 14, 2008 In the ABAP Forum, there are couple of questions unanswered related to LSMW using standard program RFBIBL00 to post the FI documents. That inspried me to write this Blog. Step 1: Maintain Object Attributes For creating the FI document with the RFBIBL00 using LSMW, we have to select the object 0100, method 0000 and program RFBIBL00. Step 2: Maintain Source Structures We will create total two structures: One for header and another for item. We could have at least two line items in the FI document. So, we need to upload at least 2 records per document. To upload 2 records, we should able to pass those two records in the mapping as well as in the conversion. Create a structure with name ZFI_HEAD for the Header (BKPF).

Upload: ravitejacs627

Post on 02-Nov-2014

206 views

Category:

Documents


0 download

DESCRIPTION

LSMW

TRANSCRIPT

Page 1: 99851920-Lsmw-With-Rfbibl00.pdf

Generated by Jive on 2012-06-11+02:001

naimesh.patel: LSMW with RFBIBL00

Posted by Naimesh Patel Aug 14, 2008

In the ABAP Forum, there are couple of questions unanswered related to LSMW usingstandard program RFBIBL00 to post the FI documents. That inspried me to write this Blog.

Step 1: Maintain Object Attributes

For creating the FI document with the RFBIBL00 using LSMW, we have to select the object0100, method 0000 and program RFBIBL00.

Step 2: Maintain Source Structures

We will create total two structures: One for header and another for item. We could haveat least two line items in the FI document. So, we need to upload at least 2 records perdocument. To upload 2 records, we should able to pass those two records in the mapping aswell as in the conversion.

Create a structure with name ZFI_HEAD for the Header (BKPF).

Page 2: 99851920-Lsmw-With-Rfbibl00.pdf

naimesh.patel: LSMW with RFBIBL00

Generated by Jive on 2012-06-11+02:002

Under the ZFI_HEAD, create another structure ZFI_ITEM for items (BSEG). Put cursor onthe ZFI_HEAD and press the create button to create lower level structure ZFI_ITEM.

Step 3: Maintain Source FieldsWe need to have one link field which will link the Header record with the Item record whichsystem will use later to link the records from both different files.

These are the fields for the ZFI_HEAD structure:

These are the fields for the ZFI_ITEM structure:

Page 3: 99851920-Lsmw-With-Rfbibl00.pdf

naimesh.patel: LSMW with RFBIBL00

Generated by Jive on 2012-06-11+02:003

Step 4: Maintain Structure RelationsHere we will define the structure relationship between source structure (BGR00, BBKPF,BBSEG, etc) and target structure (ZFI_HEAD, ZFI_ITEM, etc).

Step 5: Maintain Field Mapping and Conversion RulesAssign all the fields from the ZFI_HEAD to respective fields from BBKPF and ZFI_ITEM torespective fields from BBSEG. Don't assign the CNT field to any of the field.

Make sure we pass correct formatted date (YYYMMDD) to the BBKPF.

Page 4: 99851920-Lsmw-With-Rfbibl00.pdf

naimesh.patel: LSMW with RFBIBL00

Generated by Jive on 2012-06-11+02:004

Step 6: Maintain Fixed Values, Translations, User-Defined RoutinesWe don't to maintain anything in field.

Step 7: Specify FilesCreate 2 files: 1 for header, 1 for Item. Sequence of the fields in the Structure must be sameas the fields in the file. You can download my test files: Header and Item.

Create a header file.

Page 5: 99851920-Lsmw-With-Rfbibl00.pdf

naimesh.patel: LSMW with RFBIBL00

Generated by Jive on 2012-06-11+02:005

Create another file for the Items in the same fashion.

You can change the names of the Read and Conversion files.

Page 6: 99851920-Lsmw-With-Rfbibl00.pdf

naimesh.patel: LSMW with RFBIBL00

Generated by Jive on 2012-06-11+02:006

Step 8: Assign FilesAssign the files to the structures.

Page 7: 99851920-Lsmw-With-Rfbibl00.pdf

naimesh.patel: LSMW with RFBIBL00

Generated by Jive on 2012-06-11+02:007

Step 9: Read data

Read the files specified in the Step 7

Step 10: Display read data

Displaying read data

Step 11: Convert Data

Run the convert data report to convert the input data to .conv file

Step 12: Display Converted Data

Step 13: Run program

Run program RFBIBL00 to create a session.

Page 8: 99851920-Lsmw-With-Rfbibl00.pdf

naimesh.patel: LSMW with RFBIBL00

Generated by Jive on 2012-06-11+02:008

Use BBTAX:

• To use the BBTAX structure also in the RFBIBL00, we need to create another structure (e.g. FI_TAX)under the ZFI_HEADER and same level of ZFI_ITEM.

• As ZFI_ITEM (BBSEG) and FI_TAX (BBTAX) are at the same level so, we can use the same CNT field tolink them.

• Create a Separate file as we have created for the header and item.

Use BWITH:

• BWITH is the subitem level data for the FI document. With-holding tax data is attached to the line item. So,we need to create a child structure under the ZFI_ITEM.

• Since we have created the structure at child level, we need another field to link the item data to thewithholding tax data.

• Create a separate field as we have created for the header and item.

493 Views

Aug 21, 2008 2:13 AM

I would ensure all dates were formatted correctly in the input file (eg. YYYYMMDD), instead of having to do itexplicitly in the LSMW. This is a potential source of error, and should be avoided. Better to clean up & format allsource data beforehand, adhering to SAP Data Dictionary formats.

In other words: keep your input files as clean and compliant as possible, instead of using ABAP to do the job.

Regards,

Trond

Aug 21, 2008 2:16 AM in response to

Page 9: 99851920-Lsmw-With-Rfbibl00.pdf

naimesh.patel: LSMW with RFBIBL00

Generated by Jive on 2012-06-11+02:009

...and, before I forget (and before somebody else corrects me): input formats for dates are user-dependent... thus,make sure the user settings are coherent and consistent (same goes for the famous decimal point setting!)

Trond

Aug 21, 2008 4:29 AM Naimesh Patel in response to

You are right Trond. That date format must be in the YYYYMMDD format. But I wanted to show how to write theconversion rule for the date because we always need to convert the date from user specific format to YYYYMMDD, ifit is not in SAP Specific format.

Thanks.

Regards,

Naimesh Patel

Aug 26, 2008 5:25 AM Erik Thiessen

this is a perfect example of using FB01 as a direct input with multiple line items.

good work!

Sep 9, 2008 6:43 AM Ravi Sankar Venna

Hi,

When I am able to run the batch input session created, the following error occurs for BSEG-DMBTR.

BSEG-DMBTR does not exist in the screen SAPMF05A 300

I have mapped DMBTR with the relevant field in Item Level Structure.

I tried to run this report in the foreground, then the amount in local currency field is getting blank, whereas my filecontains the data of amount and the same is also showing in "Display Converted Data" Step.

Any valueable inputs will be appreciated,

Regards,

Ravi

Sep 9, 2008 6:48 AM Naimesh Patel Ravi Sankar Venna in response to

You have to map the ZFI_BSEG-DMBTR to the BBSEG-WRBTR in Step 5.

In my example, I was having the same currency as the local currency. So, I have created DMBTR in the structureZFI_BSEG (line item) and mapped it with the both BBSEG-DMBTR and BBSEG-WRBTR.

Regards,

Naimesh Patel

Sep 9, 2008 9:51 AM Ravi Sankar Venna Naimesh Patel in response to

Page 10: 99851920-Lsmw-With-Rfbibl00.pdf

naimesh.patel: LSMW with RFBIBL00

Generated by Jive on 2012-06-11+02:0010

Hi Naimesh,

Thanks very much for your quick update. I have identified the same and it is perfectly uploading in the foreground.

However, there is an issue when I try to run this in the background. (SM35). It says Field BSEG-HKONT is not aninput field. The Procedure recommended is:

"Correct the incorrect transaction. You can do this using the option Process in foreground".

I have mapped the fields NEWKO and HKONT in BSEG as follows:

BBSEG-NEWKO = ZFI_ITEM-HKONT.

BBSEG-HKONT = ZFI_ITEM-HKONT.

Any valid inputs will be highly appreciated.

Thanks in advance,

Regards,

Ravi

Sep 9, 2008 9:56 AM Naimesh Patel Ravi Sankar Venna in response to

I guess, you would have to only pass the Next Line account (either from Customer, Vendor, GL) to the BBSEG-NEWKO. Based on the Posting Key, system will populate HKONT or KUNNR or LIFNR.

Regards,

Naimesh Patel

Sep 9, 2008 10:09 AM Ravi Sankar Venna Naimesh Patel in response to

Hi Naimesh,

Thanks for your update. I will update the threat if there is any possible resolution to this background issue. Anyway, Iam happy with the foreground at the moment. :-)

Regards,

Ravi

Nov 12, 2008 11:30 PM dinesh babu

Hi,

I created the lsmw using the steps given by you.But

while running the direct input i am getting the error like 'Editing was terminated'.

I developed this in SAP 4.7 version.

can u tell me the process to solve this or steps.

Thanks,

Dinesh

Page 11: 99851920-Lsmw-With-Rfbibl00.pdf

naimesh.patel: LSMW with RFBIBL00

Generated by Jive on 2012-06-11+02:0011

Dec 30, 2008 8:42 AM R Prasad

Hi,

I'm getting error when clicking the "read data" phase as follows:

"Ensure field sequence is correct for data for mutiple source structures"

I do have mutiple source structures as for header & item files with the same field sequence as per the Mapping andConversion Rules.

can anyone have an idea what should i do to overcome this error?

Thanks in advance

Prasad

Jan 12, 2009 6:13 AM Marianela Rodriguez

Hi! I appreciate the time you take to share this information with us.

I compared this information with my LSMW Project. I don't see any difference. But I saw in steps "read data" and"convert data" the system don't read all files I assigned. It appears to be reading only the header file.

Could you help me????

I can email you the screens, TXT files ... and the export of the project I created.

Best regards and thank you so much!!!

Marianela

Jan 12, 2009 6:37 AM Naimesh Patel Marianela Rodriguez in response to

Hello Marianela,

Have you took the CNT field in both the structures as shown in Step 3? This CNT field is required to link the Headerand Detail when it read the data.

Regards,

Naimesh Patel

Jun 11, 2009 11:21 AM Ashok Pathmanathan

Hi !

This is just an observation.

By creating suitable identifiers at the header / item / sub-item levels, apart from the counters, and having equivalentunique values in the input file, one can do away with having mulitple input files and have just a single file.

Oct 31, 2009 9:12 PM renuka pond

Not able to use LSMW program for One-Time Vendor FI Invoices posting (FB01), can someone help? withoutBDC..any other method (using bapi/idoc)...etc. Looks like direct input cannot handle vendor address input screen forOne-Time Vendor FI Invoices post.

Page 12: 99851920-Lsmw-With-Rfbibl00.pdf

naimesh.patel: LSMW with RFBIBL00

Generated by Jive on 2012-06-11+02:0012

email @ [email protected]

Oct 31, 2009 9:26 PM renuka pond Naimesh Patel in response to

How to post One-Time Vendor FI Invoices using legacy data file? LSMW with RFBIBL00 is not working...any bapi/idoc except BDC. One-Time Vendor FI Invoices posting using FB01....let me know.

Jul 27, 2010 9:40 AM Ndumiso Zwane

Thank you for this blog its super.

I have followed all the steps but come across an error when trying to read data. The error i get is "Generationcanceled: No field with this name".

Have you ever encountered such, please help in this regard.

Thank you once again...

Jul 28, 2010 3:10 AM Ndumiso Zwane Ndumiso Zwane in response to

Hi there,

This method is works, i just wanna stress the point that the link field is vital and should not be overlooked in any wayhowever is the a solution for this scenario which works with only 1 text file which includes both hearder items andLine Items???

thank you...

Aug 16, 2011 10:29 PM Asif Iqbal

Hi Naimesh,

Thanks for such a nice document. I have followed the instructions but I am getting problem when I do read data (step8). Against one header record its reading all the segment record. for example if i have 10 segment line items it willread all 10 items for each header record. can you please help.

Cheers,

Asif

May 8, 2012 9:57 AM Akhil Baluja

Hi Naimesh,

First of all thanks for such a nice document. Even after so many years it is quite explanatory& useful.

Page 13: 99851920-Lsmw-With-Rfbibl00.pdf

naimesh.patel: LSMW with RFBIBL00

Generated by Jive on 2012-06-11+02:0013

I am also reproducing the same scenario for posting a Accounting Document & I havecleared all the steps except the last one:

Step 13: Run program

Run program RFBIBL00 to create a session.

Here I am finding some issues like:

If I choose Data transfer type as 'D' with Extended log as 'X', I am getting following message:

Batch Input Documents

FB032 Program must run in batch since more than 20 documents are to beposted

FB013 ....Editing was terminated

However, if the number of document is less than 20, they are processed correctly.

If I choose Data Transfer type as 'B' then also in the Batch session SM35, I am gettingfollowing error message:

"Field BSEG-VALUT. does not exist in the screen SAPMF05A 0300"

Page 14: 99851920-Lsmw-With-Rfbibl00.pdf

naimesh.patel: LSMW with RFBIBL00

Generated by Jive on 2012-06-11+02:0014

In the above two scenarios how I can use LSMW to post documents.

Regards,

Akhil