1

I have an importing parameter of Table Type in a Function Module / BAPI which is having only one field (material number). I want to enter hundreds of rows to that Parameter and save it as test data.

If I follow the normal procedure, I have to create new row and enter/paste a material. And this has to be repeated for every material as bulk data cannot be pasted into that!

Can anybody know what is the best way to enter and save bulk data for the importing/table parameter?

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
Rahul Gupta
  • 111
  • 1
  • 5

3 Answers3

1

Putting this here for posterity, even though this is an old ticket.

It's possible using DEBUG, if you can edit the fields. Put the breakpoint in FM RS_COMPLEX_OBJECT_EDIT.

Use SE37 to test your FM, and when it stops at the breakpoint, add your records to parameter OBJECT using UPLOAD FROM FILE.

Would be nice if there were a standard "upload" to fill fields in SE37, and ALSO if it didn't truncate more than a screenful of records.

Rwells
  • 11
  • 1
  • The backend debugger has the option to initalize an internal table in the debugger by [uploading a file, since ABAP 7.02](https://blogs.sap.com/2015/02/09/procedure-to-upload-an-excel-data-into-an-internal-table-while-debugging-in-sap-abap/). – Sandra Rossi Dec 01 '19 at 19:59
  • The backend debugger has the option to create the test data via the option [Save as test data](https://blogs.sap.com/2016/04/13/save-test-data-for-function-module-via-debugger/) in the Fast Variable view, and the current debugged object must be the concerned function module. – Sandra Rossi Dec 01 '19 at 20:02
0

You must create the same typed table in Your calling program. In the program You can add as much materials as You want by adding each lv_matnr to the local table (in a loop for example).

Then You pass Your local table to Your function module when You call it with exporting and voila.

The called function module receives as much matnr entries, as You passed during call.

Did that help?

Uwe Keim
  • 39,551
  • 56
  • 175
  • 291
icbytes
  • 1,831
  • 1
  • 17
  • 27
  • Yes, multiple values can be passed using a program. But my requirement is to add it as a Test Data in Test Data Directory of the FM. Any idea on that? – Rahul Gupta Nov 26 '13 at 12:35
  • Inside the BAPI Tester there You click on the importing parameter table symbol and there is a "New Line" in the Pushbutton menu on the top. Line for line You can insert data there and save it. All right ? – icbytes Nov 26 '13 at 15:00
  • Yes, but if I have to insert 100 entries, I need to insert 1 line, paste the value and repeat this 100 times. Say for example, I inserted 5 new lines and copied five values in clipboard. When I try to paste these five values keeping my cursor on the first line, only the first value gets pasted. It only takes one value at a time. – Rahul Gupta Nov 27 '13 at 06:44
  • What about the very right diskette symbol if having Some thing in clipboard? Does this work for You? – icbytes Nov 27 '13 at 07:24
  • No. That paste button does not help. Nothing gets pasted and control comes to the previous screen. – Rahul Gupta Nov 27 '13 at 08:58
  • Then I only can recommend creating a wrapper function module, which will collect the testdata programatically for You and then calls the desired function module. I see no other option until now. – icbytes Nov 27 '13 at 09:03
0

Just want to convert Sandra's valuable comment into an answer.

Save to test data option is available in ABAP debugger since 7.40 or earlier and can be activated like this

test1

test1

To fill data to debugger parameter you can use Upload from local file tooling.

Another option for RFC modules is using FBGENDAT program. That way you just running your module in special mode and it "remembers" this run and saves it into Test Directory.

Suncatcher
  • 10,355
  • 10
  • 52
  • 90