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: 

VA21 / VA22 import positions from file

0 Kudos

Hi Everyone,

When normal user adds positions to table in transaction VA22, he needs to fill material number, quantity and unit. Rest of the data are filled automatically after proceding a screen.

I need to import positions data from file (CSV). To do this I eddited screen 4411 and add "Import" button (configuration to tables T185* is set). Problem is when I try to fill internal table xvbap. It's not filling the rest of data. Is it any simple way to import data from file and force transaction to proced as it was manual data imput?

PS. Someone told me that I can try to use BOM standard code to this but I don't know where to find it and even is this a good solution.

Best Regards,

Marcin

7 REPLIES 7

marc_augustin2
Active Participant
0 Kudos

Hi Marcin,

can you record VA22 via batch-input? If so, you could use LSMW to insert data from the text file.

Regards,

Marc

0 Kudos

Dear Marc,

Batch-Input would be fine if I'd like to start the transaction from the beggining. I need to fill the table at button click so Batch-Input won't help. Filling table from file is not a problem. Problem is to fill rest of data like in manual data input.

Regards,

Marcin

surajarafath
Contributor
0 Kudos

after filling up your data from the CSV file to the internal table pressing enter manually by user will fill the rest of the data rite? do you have problem doing this?

Or else, you can force the enter button by triggering PBO explicitly using the below code..

   cl_gui_cfw=>flush( ).

   CALL FUNCTION 'SAPGUI_SET_FUNCTIONCODE'

     EXPORTING

       functioncode           = '/00'

     EXCEPTIONS

       function_not_supported = 1.

0 Kudos

Unfortunatelly pressing enter after filling data is not helping. Due to this situation this method will not help. But thanks for reply.

Regards,

Marcin

sivaprasad_paruchuri
Active Participant
0 Kudos

Create a Bdc Or lsmw...

Regards,

Siva prasad.

0 Kudos

Like I said it's not possible. File need to be uploaded in transaction after Import button click.

0 Kudos

OK Guys,

I used function module DYNP_UPDATE_FIELDS and it works almost great except one thing. I can't add more rows than I seeon the screen. For example when I start VA22 I see 9 position rows in table control but I can't add more by this FM. Is there any solution to this?

Best Regards,

Marcin