‎2005 Aug 30 5:21 PM
Hello ABAPers,
I have a requirement here.
1. Enter transaction BD10.
2. Click the arrow(multiple selection) besides MATERIAL field on the screen.
3. On the pop up window click on the button 'Import from text file'.
All the materials which are present in the text file will be loaded in to the selection field of the material.
My requirement is I want to automate this whole process. Let me put the requirement in more detail.
1. When I enter transaction BD10, the selection field of the material should be automatically populated with the materials from all the text files in a folder.
For example if the folder contains 10 text files with materials...when I enter BD10 the selection field for material should be populated with all materials from those 10 text files.
I tried using a variant...but I couldn't do it.
All suggestions are most welcome.
Thanks,
Naren
‎2005 Aug 30 5:29 PM
First you will need a custom program to read the directory and upload the files into the program, then you can put all of the files into one internal table, then using the SUBMIT statement you can submit program RBDSEMAT using the WITH extension for all the matrial.
ranges: r_matnr for mara-matnr.
* Build r_matnr with the data uploaded.
* ITAB is an internal table with all of
* your uploaded material numbers.
loop at itab.
clear r_matnr.
r_matnr-sign = 'I'.
r_matnr-option = 'EQ'.
r_matnr-low = itab-matnr.
append r_matnr.
ENdloop.
SUBMIT RBDSEMAT
with MATSEL in r_matnr
and return.Regards,
Rich Heilman
Message was edited by: Rich Heilman
‎2005 Aug 30 5:29 PM
First you will need a custom program to read the directory and upload the files into the program, then you can put all of the files into one internal table, then using the SUBMIT statement you can submit program RBDSEMAT using the WITH extension for all the matrial.
ranges: r_matnr for mara-matnr.
* Build r_matnr with the data uploaded.
* ITAB is an internal table with all of
* your uploaded material numbers.
loop at itab.
clear r_matnr.
r_matnr-sign = 'I'.
r_matnr-option = 'EQ'.
r_matnr-low = itab-matnr.
append r_matnr.
ENdloop.
SUBMIT RBDSEMAT
with MATSEL in r_matnr
and return.Regards,
Rich Heilman
Message was edited by: Rich Heilman
‎2005 Aug 30 5:34 PM
Hello Rich,
Thankyou very much for the solution. I will try your solution and award you the points by the end of the day.
Thanks,
Naren
‎2005 Aug 30 5:37 PM
‎2005 Aug 30 5:42 PM
Also, here is a proof-of-concept for ya.....
report zrich_0002 .
data: itab type table of makt with header line.
ranges: r_matnr for mara-matnr.
select * into corresponding fields of table itab
from makt up to 100 rows
where spras = sy-langu.
loop at itab.
clear r_matnr.
r_matnr-sign = 'I'.
r_matnr-option = 'EQ'.
r_matnr-low = itab-matnr.
append r_matnr.
endloop.
submit rbdsemat
with matsel in r_matnr
via selection-screen
and return.
check sy-subrc = 0.
This program will pick up 100 records from MAKT and feed the material numbers into the range, the calls the BD10 program with the range. When the screen for BD10 comes up, notice that you have 100 entries in the material number field.
Regards,
Rich Heilman
‎2005 Aug 30 10:38 PM
Hello Rich,
Thanks a lot for your solution. It has solved my problem. I awarded you full 10 points.
Thanks,
Naren