2015 Apr 06 7:37 AM
Hello experts,
I have a requirement I need to display the fields in the format given below:
MATERIAL NUMBER PLANT STORAGELOC1 STORAGELOC2
1000 1234 1200 1500
I am unable to do so using the table mard. So can anyone help.
Regards
Nav
2015 Apr 06 8:46 AM
Hello Navratan,
Can you tell us the problem you are facing ?
Regards
2015 Apr 06 7:56 AM
Hi Kumar,
Do you want this displayed in a report program or via SE16/SE16N ?
Regards.
2015 Apr 06 7:59 AM
2015 Apr 06 8:16 AM
Hi Kumar,
At a given time how may materials do you want to view in this manner is it just one or many ?
Regards
2015 Apr 06 8:31 AM
Hello Majeed
I have created a selection screen and for that particular material number I have to display in the required format.
Regards
Nav
2015 Apr 06 8:52 AM
Hi Kumar,
In MARD table since there will be varying no of storage.l for different materials when developing the report program you might have to take a dynamic approach.
Regards
2015 Apr 06 9:07 AM
Hello Majeed,
I am able to display the storage location and material but it comes in a vertical way but I need to display it in a horizontal manner.
Regards
Nav
2015 Apr 06 8:46 AM
Hello Navratan,
Can you tell us the problem you are facing ?
Regards
2015 Apr 06 9:12 AM
Hi Sajid,
I have been trying to make a report in the above format but I am unable to do so as I get all the storage location in a vertical format and I need to display it horizontally.
Regards
Nav
2015 Apr 06 10:30 AM
hi,
i think u have data some thing like this,
and u want display BA60 under storage location1 and BCB0 under storage location 2 respectively,
if this is the case then u need to loop at the internal table and find the count against each material number and accordingly display u r storage location...
2015 Apr 06 10:33 AM
2015 Apr 07 3:13 PM
Hello Vinay ,
I just want to display the quantity of stock in the storage location against each material number .I have already tried to create the table dynamically but facing a problem in adding the the quantity for storage location agains each material number.
I want to diaplay it this way:
material plant strg loc1 strg loc2
101 1234 200
102 1235 1200
2015 Apr 07 3:41 PM
Hello Rajkumar,
Thanks for your reply I will try the method you suggested .Its really a different approach.
Regards
Navratan
2015 Apr 08 8:19 AM
Hello Rajkumar,
I tried the way you suggested but in this case I have to manually enter all the quantity for each location and this is really a hectic process and I have to make it such that it keeps on updating and the data are very large so really tough to do so.
Regards
Navratan
2015 Apr 08 10:50 AM
Hi Navratna,
If you maintain the internal table as shown below, it is possible to use the dynamic internal table concept and convert the alv layout as expected.
material plant SLOC Value
101 1234 LOC1 200
102 1235 LOC2 200
material plant strg loc1 strg loc2
101 1234 200
102 1235 200
Regards
Rajkumar Narasimman
2015 Apr 08 11:06 AM
Hello Rajkumar,
I am facing the problem as the storage locations are not fixed and have a huge data that has to be updated automatically.So kindly could you explain me the logic.
Regards
Navratan
2015 Apr 08 2:44 PM
Hello Navratan,
Adding onto Rajkumar's answer.
I had a similar requirement.
What I did was, made the field names in the internal table the same as (or containing the ) storage location number.
So, this helped me match the data to the appropriate column.
For example,
when looping on the data from mard,
I can see the data contains 3 storage locations.
so, I would build my alv table to have columns as
<other fields> LOC1 LOC2 LOC3
then when putting in data into this table, I can insert into the appropriate column.
2015 Apr 08 3:12 PM
Hello Sajid,
What I did was made a columns for different storage locations with the same field name as in the table but when I tried to add the quantity to each storage location I get the same values for every storage location and I have to do add quantity for almost 20 storage location against each material number.If you could then please explain with an example.
Regards
Navratan.
2015 Apr 09 8:33 AM
Hello Navratan ,
Please find pseudocode below.
Here, I am assuming, you have built the fieldcatalog first and then you have built the dynamic internal table using this field catalog.
Loop at gt_mard. "get the data from MARD
READ TABLE gt_fieldcat INTO gst_fieldcat
WITH KEY fieldname = gt_mard-LGORT. "here you get the location of the column
lw_tabix = sy-tabix. "here you get the position of the column in the alv internal table
ASSIGN COMPONENT lw_tabix OF STRUCTURE <gfs_s_dyntable> TO <gfs_alv_col>. "here you are asigning the data from the alv dynamic table to a. <gfs_s_dyntable> is a structure of the dynamic internal table, which is appended to the internal table. <gfs_alv_col> contains the data.
MOVE gt_mard-LABST TO <gfs_alv_col>.
gw_labst = gw_labst + gt_mard-LABST. "if you need to calculate total stock
endloop.
APPEND <gfs_s_dyntable> TO <gfs_dyntable>. "append struture to internal table.
2015 Apr 09 9:24 AM
Hello Sajid,
Thanks for your reply.I will try then let you know about it.
Regards,
Navratan
2015 Apr 06 11:47 AM
Hello Navratan,
You will have to either use the dynamic internal table concept (if the storage locations are not fixed)
Or loop at the data from MARD and enter the data into your internal table. (If the storage locations to be displayed are known and fixed.)
2015 Apr 15 1:05 PM