Académique Documents
Professionnel Documents
Culture Documents
1 of 9
https://archive.sap.com/discussions/thread/174259
11/1/2016 8:52 AM
2 of 9
https://archive.sap.com/discussions/thread/174259
Hi,
can any one help me out for populating the appended field to data source.
<u><b>My requirement:</b></u> I have enhanced the data source 2lis_11_vahdr by appending the field
zzmatnr in to its extract structure, Now i want to populate this field from the field available in the MARC
table. so can any one help me out the whole code for this?
apart from this i have one another question that is if i append this field to the communication structure( like
mcvbak, mcvbap... etc) then how we will populate this field.
and what is the exact difference between appending the field to the extract structure and appending the
field to the communication structure.
Thanks
anu gupta
July 06, 2006 at 10:19 AM
0 Likes
Correct Answer
Krishnamoorthy Gopalakrishnan
replied
July 06, 2006 at 11:34 AM
1)Just a sample code to add old material code(zzoldmatno) to the data source
'2LIS_02_S012'.
The function module is EXIT_SAPLRSAP_001.
11/1/2016 8:52 AM
3 of 9
https://archive.sap.com/discussions/thread/174259
Correct Answer
11/1/2016 8:52 AM
4 of 9
https://archive.sap.com/discussions/thread/174259
Correct Answer
Krishnamoorthy Gopalakrishnan
replied
July 06, 2006 at 11:34 AM
11/1/2016 8:52 AM
5 of 9
https://archive.sap.com/discussions/thread/174259
anu gupta
replied
hi gopi
thanks it is help ful for me but can u not send me exact user exit code
meeting my requirement.
anu
0
anu gupta
hi
i have written one code to populate the zzmatnr from matnr from
mara.
case i_datasource.
when 's_11_vahdr'.
data:it_MC11VA0HDR like MC11VA0HDR,
wa_matnr like mara-matnr.
tables mara.
loop at c_t_data into it_MC11VA0HDR.
l_tabix = sy-tabix.
select single matnr from mara into wa_matnr where matnr =
it_MC11VA0HDR-matnr.
if sy-subrc = 0.
11/1/2016 8:52 AM
6 of 9
https://archive.sap.com/discussions/thread/174259
if sy-subrc = 0.
it_MC11VA0HDR-zzmatnr = wa_matnr.
endif.
clear wa_matnr.
modify c_t_data from it_MC11VA0HDR index l_tabix.
but it is giving the error like......The data object "IT_MC11VA0HDR"
has no component called "MATNR", but there is a component called
"ZZMATNR".
can any one please correct it.
0
Srinivas Neelam
replied
July 06, 2006 at 14:09 PM
Hi Anu,
select single <b>matnr</b> from mara
into wa_matnr where <b>matnr</b> =
it_MC11VA0HDR-matnr.
Anu, according to this code you are
passing MATNR and fetching MATNR
only, why so...!! If you have MATNR in
your datasource, why you want to
enhace,,,??
Check extract structure(MC11VA0HDR)
having newly added field(ZZMATNR) or
not...?? and remove the Hide button.
Hope it Helps
Srini
0
anu gupta
replied
July 06, 2006 at 14:36 PM
11/1/2016 8:52 AM
7 of 9
https://archive.sap.com/discussions/thread/174259
anu gupta
replied
July 06, 2006 at 14:36 PM
hi srini
thanks for help.
actually i am using
2lis_11_vahdr, this data source
is not having the matnr, but
irequire this field bw side, so i
appended this datasource by
zzmatnr.
No i want to simply populate this
field by matnr that is in the mara
table.
so please send me whole code if
u can, it will be help ful for me.
thanks
0
Srinivas Neelam
replied
July 06, 2006 at 15:17 PM
Anu,
Pre-requisites to enhance a data
source.
1. All primary keys of the
table(here table MARA & primary
key MATNR) should be available
in datasource.
2. Based on this field you can
enhance the datasource and can
fetch some other fields by
passing this(MATNR).
So, in this case, You can not
fetch data from MARA.
3. Here you are having two
options, Find out the table which
can provide MATNR(not MARA).
OR
11/1/2016 8:52 AM
8 of 9
https://archive.sap.com/discussions/thread/174259
anu gupta
replied
July 06, 2006 at 15:06 PM
ok srini,
thanks
0
Krishnamoorthy Gopalakrishnan
replied
July 06, 2006 at 15:00 PM
case i_datasource.
when 's_11_vahdr'.
data:it_MC11VA0HDR like
MC11VA0HDR,
wa_matnr like mara-matnr.
tables mara.
loop at c_t_data into it_MC11VA0HDR.
l_tabix = sy-tabix.
select single matnr from VBAP into
wa_matnr where VBELN =
it_MC11VA0HDR-VBELN.
if sy-subrc = 0.
11/1/2016 8:52 AM
9 of 9
https://archive.sap.com/discussions/thread/174259
it_MC11VA0HDR-VBELN.
if sy-subrc = 0.
it_MC11VA0HDR-zzmatnr = wa_matnr.
endif.
clear wa_matnr.
modify c_t_data from it_MC11VA0HDR
index l_tabix.
Please check the code
Regs
Gopi.
0
Krishnamoorthy Gopalakrishnan
replied
July 06, 2006 at 14:05 PM
anu gupta
replied
Hi gopi
sorry that is not marc table , it is mara table, now if u have some time
please send me the whole code keeping in the view of my requirement.
11/1/2016 8:52 AM