How to map IDoc segment with qualifiers
Hi everyone!
I have the following problem: In an IDoc of type DESADV01 there can be several segments of type E2EDS01. Each segment has a different qualifier, which is the value of the field SUMID in this case. My target structure (type EDIFACT) now has several segments, each again with a sort of qualifier. Now I have to map the values of certain source segments to the respective target segments.
Exaple (in XML format):
Source
<E1EDS01 SEGMENT="1">
<SUMID>021</SUMID>
<SUMME>0000000001.000</SUMME>
<SUNIT>KGM</SUNIT>
</E1EDS01>
<E1EDS01 SEGMENT="1">
<SUMID>022</SUMID>
<SUMME>0000000001.000</SUMME>
<SUNIT>KGM</SUNIT>
</E1EDS01>
Target
<S_MEA>
<C_C502>
<D_6313>N</D_6313>
</C_C502>
<C_C174>
<D_6411>KGM</D_6411>
<D_6314>1</D_6314>
</C_C174>
</S_MEA>
<S_MEA>
<C_C502>
<D_6313>G</D_6313>
</C_C502>
<C_C174>
<D_6411>KGM</D_6411>
<D_6314>1</D_6314>
</C_C174>
</S_MEA>
(i have omitted several details here, but I'm only interested in the general procedure anyway).
So in general the source segment with qualifier "021" should be mapped to a target structure with qualifier "N" etc.
How can this be done using standard XI mapping techniques?
Regards, Joerg
Hi everyone!
Thanks for your input data - unfortunately this wasn't quite what I was looking for. However I thik I solved my original problem and I just wanted to share this solution with you - maybe it helps others, maybe some of you have suggestions what I could do differently.
To sum up the requirement: There can be multiple input segments, each with a certain qualifier. These input segments have to be mapped to the target segments, respectively - however, the qualifiers change. There can be several segments with qualifiers that do not match the requirement, and required segments might be missing.
So here's what I came up with:
Use the qualifier of the source segments as an input to a <b>FixValues</b> function. In this function, map the desired qualifiers to the value <b>true</b>, use <b>false</b> as the default value. Map the output of the <b>FixValues</b> function to a <b>createIf</b> function and use this to create the desired output segment. This way, for each of the required segments, one target segment will be created. All other segments (with unwanted qualifiers) will be removed.
So far, this technique worked for me - do you have improvements/suggestions?
Regards, Joerg
Similar Messages
-
How to map Idoc fields with external file
Hi All,
How to map Idoc fields with external file.
I want to check the settings where Idoc fields are mapped with external file.
Thanks in advance.
Regards,
Govind.If you have configured a fileport where on trigger of IDOC you are creating the file, you can look at the message type documentation and get the offset values for each field in each segment
-
How to map idoc segment field E1IDB02-FIIKONTO with BSEG-ESRNR.
Hi,
I have searched for lot of threads in the forum , and also i tried myself but i am not able to map this fields segment with my logic, so please anyone kindly contribute in mapping idoc segment field with the logic given below:
idoc type :PAYEXT outbound idoc.
message type: PEXR2002
This is my logic: i need to populate the ISR number(BSEG-ESRNR ) in idoc segment field( E1IDB02-FIIKONTO)
DATA : str1 TYPE string,
len1 TYPE i,
len2 TYPE i,
str2 TYPE string,
str3 TYPE string.
str1 = '01-1234-4'. ---> BSEG-ESRNR "ISR Subscriber Number
REPLACE FIRST OCCURRENCE OF '-' IN str1 WITH '_'.
REPLACE ALL OCCURRENCES OF '-' IN str1 WITH space.
CONDENSE str1.
len1 = STRLEN( str1 ).
IF len1 LT '9'.
len2 = '9' - len1.
CASE len2.
WHEN '1'.
REPLACE ALL OCCURRENCES OF '_' IN str1 WITH '00'.
WHEN '2'.
REPLACE ALL OCCURRENCES OF '_' IN str1 WITH '000'.
WHEN '3'.
REPLACE ALL OCCURRENCES OF '_' IN str1 WITH '0000'.
WHEN '4'.
REPLACE ALL OCCURRENCES OF '_' IN str1 WITH '000000'.
WHEN OTHERS.
ENDCASE.
ELSEIF len1 EQ '9'.
REPLACE ALL OCCURRENCES OF '_' IN str1 WITH '0'.
ELSEIF len1 GT '9'.
REPLACE ALL OCCURRENCES OF '_' IN str1 WITH space.
CONDENSE str1.
ENDIF.
Thanks in Advance.Resolved.
-
Read IDOC segment with qualifier
Hi,
I need to read data into a workArea from a IDOC segment which has Qualifiers for it.
The IDOC or BASIC type is DELVRY03.
Segment E1EDT13.
Qualifier 006
Thx in advance
MacDATA:
lx_e1edt13 TYPE e1edt13.
FIELD-SYMBOLS:
<fs_idoc_data> LIKE LINE OF idoc_data.
LOOP AT idoc_data ASSIGNING <fs_idoc_data> WHERE segnam = 'E1EDT13'.
lx_e1edt13 = <ls_idoc_data>-sdata.
IF lx_e1edt13-qualf = '006'.
your code
or get the data into internal table as per your requiremnt
ENDIF.
ENDLOOP. -
How to map idoc segments to multiple output structures
Dear experts,
On Pi I need to map segments from an Idoc to 2 different outputstructures. My scenario is as follows:
incoming Idoc on PI -> if segment eq 'X' then map to outputstructure '1'; if segment eq 'Y' then map to outputstructure '2'
Idoc structure is as follows:
- 1 header segment
- 1..n detail segments (which I need to map to outputstructure 1)
- 1 summarisation segment (which I need to map to outputstructure 2)
Output needs to be a .txt file.
I would like to use the graphical message mapping on PI, how can I map the Idoc to multiple output structures?
Thanks in advance,
WilliamHi
You can do 1:n multimapping
in message mapping in messages tab ..add both the structures in target tab and do the mapping
and in operation mapping add both the message interface on the target side
PLease go through this blog
/people/jin.shin/blog/2006/02/07/multi-mapping-without-bpm--yes-it146s-possible -
How to map a query with the Multiprovider?
Hello All,
Can any one please tell me how to map a query with a multiprovider?
Appreciate your help.
Regards,
Soumya.Hi,
Can you please elaborate , do you mean how to create a query with multiprovider. if that is your question it is very simple just create the query on the multiprovider.
What is the purpose for mapping the query with multiprovider -
How to find IDOC no with reference to one billing document no
Dear all,
Can you please tell :
How to find IDOC no with reference to one billing document no
ThanksHi Pavan,
You are absolutely correct. But what i need to know is sometime , even in the sales order there will be no output type (basically inbound) which can be found as suggested by Sunil - I think that is the most relevant way to find the IDOC no. Hope you will agree with me. Again how to activate by IAN is also guides the idea. Only thing we need to know the exact parameter to be maintained in own data.
Thanks for your one of the valid suggestion.
Regards,
Ranjan -
IDOC: How to create child segment with abap code.
Hi,
I'am trying to write an abap code to create segments for an Idoc which structure is the following:
ZLE_00060_DLVY
> E1EDL20
> Z1DEL_CONS
>Z1DEL_MAT_HEADER
> Z1DEL_MAT
> E1EDL20RET2
> E1EDL22
> E1EDL21
> E1EDL23
> E1EDL51
I receive a sintax error: Error in IDoc with status 26 .
Checking the result I note all segment at the same level and an error about the segment E1EDL22
EDI: Syntax error in IDoc (segment cannot be identified)
Message no. E0078
Diagnosis
The segment E1EDL22 does not occur at the current level of the basic
type DELVRY05 (extension ZLE_00060_DLVY).
This error can have several reasons:
o The segment E1EDL22 is assigned to a group whose header segment does
not occur.
o The segment E1EDL22 does not exist in the syntax description of the
basic type DELVRY05 (extension ZLE_00060_DLVY).
o The sequence of segments in the group in which the segment appears
is incorrect.
Previous errors ('mandatory' segment or group missing) may be due to
this error.
Procedure
Please check the IDoc or the syntax description of the basic type
DELVRY05 (extension ZLE_00060_DLVY).
After the error I have:
data records
E1EDL20
Z1DEL_CONS
Z1DEL_MAT_HEADER
Z1DEL_MAT
Z1DEL_MAT
Z1DEL_MAT
Z1DEL_MAT
Z1DEL_MAT
Z1DEL_MAT
Z1DEL_MAT
Z1DEL_MAT
Z1DEL_MAT
Z1DEL_MAT
Z1DEL_MAT
Z1DEL_MAT
Z1DEL_MAT
Z1DEL_MAT
E1EDL20RET2
E1EDL22
E1EDL21
Abap code:
idoc_data-segnam = 'Z1DEL_CONS'.
idoc_data-sdata = s_z1del_cons.
append idoc_data.
idoc_data-segnam = 'Z1DEL_MAT_HEADER'.
s_z1del_mat_header-tsegment = 'MATERIAL'.
idoc_data-sdata = s_z1del_mat_header.
append idoc_data.
clear idoc_data-sdata. <<<<<<<<<<< how to indent the structure because this is a child.
idoc_data-sdata = s_Z1DEL_MAT.
idoc_data-segnam = 'Z1DEL_MAT'.
append idoc_data.
idoc_data-segnam = 'E1EDL20RET2'.
idoc_data-sdata = s_E1EDL20RET2.
append idoc_data.
clear idoc_data.
idoc_data-segnam = 'E1EDL22'.
idoc_data-sdata = s_e1edl22.
append idoc_data.
clear idoc_data.
idoc_data-segnam = 'E1EDL21'.
idoc_data-sdata = s_e1edl21.
append idoc_data.
Any help will be well appreciated.
Thanks in advance.
Regards,
GiovanniHi,
following in debugging mode the abap code of the INCLUDE ZXTRKU02 where is defined the TABLES IDOC_DATA STRUCTURE EDIDD, I find that all field of the table IDOC_DATA are not set. More exactly my expectation is to find values for SEGNUM, HLEVEL, PSGNUM.
In a few words I need to execute an enhancement, via abap code, of the struscure of the idoc before sending it out since I have a requirement to test this enhancement in my XI environment, receiving as input this ideoc modified.
Then, I need to add a new segment and one child.
Any suggestion will be well appreciated.
Thanks in advance.
Regards,
Giovanni -
How to Map IDOC Extensions in LSMW
HI,
I am working on a conversion for uploading material master using IDOC Method, There is an extension in the IDOC can anyone tell me how to map the extensions in the LSMW.
ADVANCE Thanks
Guhapriyan SubrahmanyamHi guhapriyan,
if you have any extension associated with MATMAS then it will display when you press F4 on extension, form the list you can choose the extension.
and proceed ....
the extension is for custom fields ,for this you need extend the idoc. if you add the extension to it, in lsmw extension you can see them...
Regards
vijay -
How to populate IDOC segments...
Hello Experts,
I was just tasked to add new fields in an IDOC segment. My question is, how do I populate
those newly created fields? The data will be coming from a purchase order.
Thank you guys and take care!Hi,
U cannot edit the existing segment u have to create a zsegment with the fields and then under the main segment u have to add this new segment..also u have create a extended idoc in ur case...then only u can add this new segment..also once u create a segment u have to release it...
u have to write the code in the userexit only...
check the sample code which i have done for my requirement for sales order..
*& Include ZXVEDU02
Program: Function Module:EXIT_SAPLVEDC_002 Creation Date: 12-04-2006 *
Program Type : Outbound IDOC Enhancement *
Program Description:OutBound IDOC Enhancement *
Modification ID:001 *
Date : 25-05-2006 *
Description : 1.The sales organization master data needs to be sent as supplier party
details.New segment ZZSALORG is created and attached to the parent
segment E1EDK01
2.Data required to be sent are:
1.NAME1- Sales organization name
2.STRAS- Address
3.TELFX- Fax number
4.TELF1- phone number.
3.ZZSALORG is filled with the above information.
Modification ID:002 *
Date : 09-06-2006 *
Description : A new field zstceg added to the segment zzdochdr and it was populated *
by selecting stceg field from Kna1 table *
Modification ID:001 *
Date : 15-06-2006 *
Description : 1.New segment ZZE1EDP01 is created and attached to the parent segment E1EDP01
2.Data required to be sent are:
1.POSEX- Item number
2.UEBTO- Overdelivery tolerance
3.UNTTO- Underdelivery tolerance
3.ZZE1EDP01 is filled with the above information.
*-- Data Declaration--
*-- Constant Declaration--
CONSTANTS: c_1(1) TYPE c VALUE '1',
c_langu LIKE t005t-spras VALUE 'E',
c_parvw LIKE vbpa-parvw VALUE 'RG',
c_e1edk01(7) TYPE c VALUE 'E1EDK01',
c_e1edk02(7) TYPE c VALUE 'E1EDK02',
c_e1edk17(7) TYPE c VALUE 'E1EDK17',
c_e1edka1(7) TYPE c VALUE 'E1EDKA1',
c_e1edk14(7) TYPE c VALUE 'E1EDK14',
c_004(3) TYPE c VALUE '004',
c_001(3) TYPE c VALUE '001',
c_002(3) TYPE c VALUE '002',
c_re(2) TYPE c VALUE 'RE',
c_we(2) TYPE c VALUE 'WE',
c_ag(2) TYPE c VALUE 'AG',
c_0010(4) TYPE c VALUE '0010',
c_zzdochdr(8) TYPE c VALUE 'ZZDOCHDR',
c_ze1edk02(8) TYPE c VALUE 'ZE1EDK02',
c_zze1edk17(9) TYPE c VALUE 'ZZE1EDK17',
c_zze1edka1(9) TYPE c VALUE 'ZZE1EDKA1',
c_pe(2) TYPE c VALUE 'PE',
c_y(1) TYPE c VALUE 'Y',
c_zze1email(9) TYPE c VALUE 'ZZE1EMAIL',
c_zzsalorg(8) TYPE c VALUE 'ZZSALORG',
c_zze1edp01(9) TYPE c VALUE 'ZZE1EDP01',
c_e1edp01(7) TYPE c VALUE 'E1EDP01'.
*-- Variables Declaration--
DATA: lv_vbeln LIKE vbak-vbeln,
lv_country LIKE t005t-landx,
lv_text1 LIKE t042z-text1,
lv_vzskz LIKE knb1-vzskz,
lv_inco LIKE tinct-bezei,
lv_cadnr LIKE akkp-cadnr,
lv_pernr LIKE pa0105-pernr,
lv_parvw LIKE tpar-parvw,
lv_adrnr LIKE tvko-adrnr,
lv_zinso LIKE t056z-zinso,
Begin of Mod-002
lv_stceg TYPE stceg.
End of Mod-002
Begin of MOD-003
lv_min_tol TYPE KWMENG,
lv_max_tol TYPE KWMENG.
End Of MOD-003
TYPES:BEGIN OF t_vbfa,
vbelv LIKE vbfa-vbeln,
erdat TYPE erdat,
END OF t_vbfa.
DATA: i_akkp TYPE akkp.
*-- WorkArea Declaration--
DATA : wa_zdochdr TYPE zzdochdr,
wa_ze1edk02 TYPE zze1edk02,
wa_ze1edk17 TYPE zze1edk17,
wa_zze1email TYPE zze1email,
wa_zzsalorg TYPE zzsalorg,
wa_zze1edp01 TYPE zze1edp01,
wa_e1edk02 TYPE e1edk02,
wa_e1edk17 TYPE e1edk17,
wa_e1edka1 TYPE e1edka1,
wa_e1edk01 TYPE e1edk01,
wa_e1edp01 TYPE e1edp01,
wa_adrc TYPE adrc,
wa_pa0105 TYPE pa0105,
wa_zze1edka1 TYPE zze1edka1,
wa_zzdochdr TYPE zzdochdr,
wa_vbfa TYPE t_vbfa,
wa_vbpa TYPE vbpa.
*-- Move data to ZZDOCHDR Segment--
CASE int_edidd-segnam.
WHEN c_e1edk01.
MOVE int_edidd-sdata TO wa_e1edk01.
*--Begin of MOD001+(Modification ID 001)--
*-- Filling of ZZSALORG segment--
SELECT SINGLE adrnr
FROM tvko
INTO lv_adrnr
WHERE vkorg EQ dxvbak-vkorg.
IF sy-subrc EQ 0.
SELECT SINGLE *
FROM adrc
INTO wa_adrc
WHERE addrnumber EQ lv_adrnr.
wa_zzsalorg-salorg = dxvbak-vkorg.
wa_zzsalorg-name1 = wa_adrc-name1.
wa_zzsalorg-name2 = wa_adrc-name2.
wa_zzsalorg-stras = wa_adrc-street.
wa_zzsalorg-telf1 = wa_adrc-tel_number.
wa_zzsalorg-telfx = wa_adrc-fax_number.
wa_zzsalorg-land1 = wa_adrc-country.
wa_zzsalorg-strs2 = wa_adrc-str_suppl1.
wa_zzsalorg-street2 = wa_adrc-str_suppl2.
wa_zzsalorg-street3 = wa_adrc-str_suppl3.
wa_zzsalorg-ort01 = wa_adrc-city1.
wa_zzsalorg-pstlz = wa_adrc-post_code1.
wa_zzsalorg-regio = wa_adrc-region.
int_edidd-segnam = c_zzsalorg.
CLEAR int_edidd-sdata.
MOVE wa_zzsalorg TO int_edidd-sdata.
APPEND int_edidd.
CLEAR: wa_adrc,
wa_zzsalorg.
ENDIF.
*--End of MOD001+(Modification ID 001)--
SELECT SINGLE text1
FROM t042z
INTO lv_text1
WHERE land1 EQ dxvbpa-land1
AND zlsch EQ dxvbkd-zlsch.
READ TABLE dxvbpa INTO wa_vbpa WITH KEY vbeln = dxvbpa-vbeln
parvw = c_parvw.
IF sy-subrc EQ 0.
Begin of Mod-002
SELECT SINGLE stceg
FROM kna1
INTO lv_stceg
WHERE kunnr = wa_vbpa-kunnr.
End of Mod-002
SELECT SINGLE vzskz
FROM knb1
INTO lv_vzskz
WHERE kunnr EQ wa_vbpa-kunnr
AND bukrs EQ dxvbak-bukrs_vf.
IF sy-subrc EQ 0.
SELECT SINGLE zinso
FROM t056z
INTO lv_zinso
WHERE vzskz EQ lv_vzskz
AND waers EQ wa_e1edk01-curcy.
wa_zzdochdr-zdoctitle = dobject-objky.
wa_zzdochdr-zdate = dobject-erdat.
wa_zzdochdr-zmestyp = dobject-kschl.
wa_zzdochdr-zmedium = dobject-nacha.
wa_zzdochdr-zlang = dobject-spras.
wa_zzdochdr-zttype = dxvbkd-kdkg1.
wa_zzdochdr-zpaymethod = dxvbkd-zlsch.
wa_zzdochdr-zpaytext = lv_text1.
wa_zzdochdr-zintonpymt = lv_zinso.
Begin of Mod-002
wa_zzdochdr-zstceg = lv_stceg.
End of Mod-002
int_edidd-segnam = c_zzdochdr.
CLEAR int_edidd-sdata.
MOVE wa_zzdochdr TO int_edidd-sdata.
APPEND int_edidd.
CLEAR : wa_zzdochdr.
ENDIF.
ENDIF.
*-- Move data to ZZE1EDK02 Segment--
WHEN c_e1edk02.
MOVE int_edidd-sdata TO wa_e1edk02.
IF wa_e1edk02-qualf EQ c_004.
SELECT SINGLE vbelv FROM vbfa INTO wa_vbfa
WHERE vbeln EQ lv_vbeln
AND vbtyp_v EQ 'B'.
IF sy-subrc EQ 0.
SELECT SINGLE erdat FROM vbak INTO wa_vbfa
WHERE vbeln EQ wa_vbfa-vbelv.
int_edidd-segnam = c_ze1edk02.
CLEAR int_edidd-sdata.
MOVE wa_vbfa TO int_edidd-sdata.
APPEND int_edidd.
CLEAR wa_vbfa.
ENDIF.
ENDIF. " IF ended for "IF wa_e1edk02-qualf = '004'" condition.
**-- Move data to ZZE1EDK17 Segment--
WHEN c_e1edk17.
MOVE int_edidd-sdata TO wa_e1edk17.
IF NOT dxvbkd-lcnum IS INITIAL.
SELECT SINGLE inco1
inco2
FROM akkp
INTO i_akkp
WHERE lcnum EQ dxvbkd-lcnum.
IF sy-subrc EQ 0.
IF wa_e1edk17-qualf EQ c_001.
wa_ze1edk17-lkond = i_akkp-inco1.
wa_ze1edk17-qualf = wa_e1edk17-qualf.
SELECT SINGLE bezei
FROM tinct
INTO lv_inco
WHERE spras EQ 'E'
AND inco1 EQ i_akkp-inco1.
IF sy-subrc EQ 0.
wa_ze1edk17-lktext = lv_inco.
ENDIF.
ELSEIF wa_e1edk17-qualf EQ c_002.
wa_ze1edk17-qualf = wa_e1edk17-qualf.
wa_ze1edk17-lktext = i_akkp-inco2.
ELSE.
ENDIF.
int_edidd-segnam = c_zze1edk17.
CLEAR int_edidd-sdata.
MOVE wa_ze1edk17 TO int_edidd-sdata.
APPEND int_edidd.
CLEAR wa_ze1edk17.
ENDIF.
ENDIF. " IF ended for not initial condition.
*--Move data to zze1edka1 Segment--
WHEN c_e1edka1.
MOVE int_edidd-sdata TO wa_e1edka1.
*--Checking the wa_e1edka1-parvw field for 'RE'--
IF wa_e1edka1-parvw EQ c_re.
IF NOT dxvbkd-lcnum IS INITIAL.
SELECT SINGLE cadnr
FROM akkp
INTO lv_cadnr
WHERE lcnum EQ dxvbkd-lcnum.
IF sy-subrc EQ 0.
SELECT SINGLE *
FROM adrc
INTO wa_adrc
WHERE addrnumber EQ lv_cadnr.
wa_zze1edka1-parvw = wa_e1edka1-parvw.
wa_zze1edka1-partn = wa_e1edka1-partn.
wa_zze1edka1-land1 = wa_adrc-country.
wa_zze1edka1-name1 = wa_adrc-name1.
wa_zze1edka1-name2 = wa_adrc-name2.
wa_zze1edka1-stras = wa_adrc-street.
wa_zze1edka1-strs2 = wa_adrc-str_suppl1.
wa_zze1edka1-ort01 = wa_adrc-city1.
wa_zze1edka1-pstlz = wa_adrc-post_code1.
wa_zze1edka1-regio = wa_adrc-region.
int_edidd-segnam = c_zze1edka1.
CLEAR int_edidd-sdata.
MOVE wa_zze1edka1 TO int_edidd-sdata.
APPEND int_edidd.
CLEAR: wa_adrc,
wa_zze1edka1.
ENDIF.
ENDIF.
ENDIF. " IF ended for "IF wa_e1edka1-parvw EQ 'RE'" condition.
*--Checking the wa_e1edka1-parvw field for 'WE'--
IF wa_e1edka1-parvw EQ c_we.
IF NOT dxvbkd-lcnum IS INITIAL.
SELECT SINGLE cadnr
FROM akkp
INTO lv_cadnr
WHERE lcnum EQ dxvbkd-lcnum.
IF sy-subrc EQ 0.
SELECT SINGLE *
FROM adrc
INTO wa_adrc
WHERE addrnumber EQ lv_cadnr.
wa_zze1edka1-parvw = wa_e1edka1-parvw.
wa_zze1edka1-partn = wa_e1edka1-partn.
wa_zze1edka1-land1 = wa_adrc-country.
wa_zze1edka1-name1 = wa_adrc-name1.
wa_zze1edka1-name2 = wa_adrc-name2.
wa_zze1edka1-stras = wa_adrc-street.
wa_zze1edka1-strs2 = wa_adrc-str_suppl1.
wa_zze1edka1-ort01 = wa_adrc-city1.
wa_zze1edka1-pstlz = wa_adrc-post_code1.
wa_zze1edka1-regio = wa_adrc-region.
int_edidd-segnam = c_zze1edka1.
CLEAR int_edidd-sdata.
MOVE wa_zze1edka1 TO int_edidd-sdata.
APPEND int_edidd.
CLEAR: wa_adrc,
wa_zze1edka1.
ENDIF.
ENDIF.
ENDIF. " IF ended for "IF wa_e1edka1-parvw EQ 'WE'" condition.
*--Checking the wa_e1edka1-parvw field for 'AG'--
IF wa_e1edka1-parvw EQ c_ag.
IF NOT dxvbkd-lcnum IS INITIAL.
SELECT SINGLE cadnr
FROM akkp
INTO lv_cadnr
WHERE lcnum EQ dxvbkd-lcnum.
IF sy-subrc EQ 0.
SELECT SINGLE *
FROM adrc
INTO wa_adrc
WHERE addrnumber EQ lv_cadnr.
wa_zze1edka1-parvw = wa_e1edka1-parvw.
wa_zze1edka1-partn = wa_e1edka1-partn.
wa_zze1edka1-land1 = wa_adrc-country.
wa_zze1edka1-name1 = wa_adrc-name1.
wa_zze1edka1-name2 = wa_adrc-name2.
wa_zze1edka1-stras = wa_adrc-street.
wa_zze1edka1-strs2 = wa_adrc-str_suppl1.
wa_zze1edka1-ort01 = wa_adrc-city1.
wa_zze1edka1-pstlz = wa_adrc-post_code1.
wa_zze1edka1-regio = wa_adrc-region.
int_edidd-segnam = c_zze1edka1.
CLEAR int_edidd-sdata.
MOVE wa_zze1edka1 TO int_edidd-sdata.
APPEND int_edidd.
CLEAR: wa_adrc,
wa_zze1edka1.
ENDIF.
ENDIF. " IF ended for "IF NOT dxvbkd-lcnum IS INITIAL" condition.
ENDIF. " IF ended for "IF wa_e1edka1-parvw EQ c_ag" condition.
*--Checking the wa_e1edka1-parvw field for 'Y'--
IF wa_e1edka1-parvw+0(1) EQ c_y.
SELECT SINGLE parvw
FROM tpar
INTO lv_parvw
WHERE parvw EQ wa_e1edka1-parvw
AND nrart EQ c_pe.
IF sy-subrc EQ 0.
SELECT SINGLE pernr
FROM vbpa
INTO lv_pernr
WHERE vbeln EQ dxvbpa-vbeln
AND parvw EQ lv_parvw.
IF sy-subrc EQ 0.
SELECT SINGLE usrid_long
FROM pa0105
INTO wa_pa0105-usrid_long
WHERE pernr EQ lv_pernr
AND usrty EQ c_0010. " communication type email
wa_zze1email-zparvw = wa_e1edka1-parvw.
wa_zze1email-zname = wa_e1edka1-name1.
wa_zze1email-zemail = wa_pa0105-usrid_long.
int_edidd-segnam = c_zze1email.
CLEAR int_edidd-sdata.
MOVE wa_zze1email TO int_edidd-sdata.
APPEND int_edidd.
CLEAR: wa_adrc,
wa_zze1email,
wa_pa0105.
ENDIF.
ENDIF.
ENDIF. " IF ended for "IF wa_e1edka1-parvw EQ 'Y'" condition.
*--Begin of MOD003 (Modification ID 003)--
*-- Move data to ZZE1EDP01 Segment--
WHEN c_e1edp01.
MOVE int_edidd-sdata TO wa_e1edp01.
wa_zze1edp01-posex = wa_e1edp01-posex.
wa_zze1edp01-uebto = dxvbap-kwmeng + ( dxvbap-kwmeng * dxvbap-uebto / 100 ).
wa_zze1edp01-untto = dxvbap-kwmeng - ( dxvbap-kwmeng * dxvbap-untto / 100 ).
wa_zze1edp01-uebto = dxvbap-uebto.
wa_zze1edp01-untto = dxvbap-untto.
int_edidd-segnam = c_zze1edp01.
CLEAR int_edidd-sdata.
MOVE wa_zze1edp01 TO int_edidd-sdata.
APPEND int_edidd.
CLEAR: wa_zze1edp01.
*--End of MOD003 (Modification ID 003)--
WHEN OTHERS.
ENDCASE.
Regards,
Nagaraj -
How to get IDOC segment occurence
Hi All,
I am trying out IDOC to File scenario and facing a problem due to repetition of segments in IDOC.
Requirement is to repeat the field in output file base on the segment occurance.
i am trying to map the record set of target file structure to the most repeating segmetn in the Souce IDOC so that i can get the repetion.
Is there any way to identify which segments repeats the most of times?
can we map a segment to target record set in where in we count all the segment occurance and get the most repeating segment and map it to target in udf itself.
is there any direct function whcih can be used in UDF to map one segment to a recordset?
Regards,
Anika1. use the wiki logic on each repeating node
2. that will give you the counts for each repeating node
3. now write a node with each count as input
4. check which is the maximum
5. then use a logic as below
assume that max_occurance variable contains the maximum repeating nodes count
then
for(int i = 0; i < max_occurance; i++)
result.addValue("");
use that UDFs output and it will create that many occurances on the target side -
Hi
I have a custom IDOC created with one of the segments being 1000 char. The data is populated through a custom program.
In WE02 I am unable to see all the 1000 char. Even if I export the IDOC to a spreadsheet or word doc it does not show completely all the characters.
I am able to use FM IDOC_Read_Completely to read the IDOC and view the complete segment but I am looking for a standard transaction.
Any inputs on how the I can view all the data in the segment in a standard trx ?.hi,
the data in the edid4-sdata is filled with according to Segement field lenght.
you can directly read from table with Idoc number from table EDID4 in se16.
or we05 or we02 or we19 or BD87 transactions.
prabhudas -
How to assign idoc segment at runtime ??
Hi ,
I have a ztable which is maintained via sm30.
The field1 is a key field and other fields are idocsegment name , idoc field , field value .
Field1 = key field
idoc segment name (field2)
idoc field (field3)
field value(field4)
How do i update idoc segment and particular field with field4 at runtime .
segment name , field and value changes with the matching key field.
loop at it_edidd into wa_edidd
where segnam = wa_ztable-idoc_segment.
wa_seg = wa_edidd-sdata.
how to assign the field at runtime ?????????????????????????
how to change the value of field ?????????????????????????
update edid4 set sdata = wa_seg
where docnum = wa_edidd-docnum
and segnum = wa_edidd-segnum
and segnam = wa_edidd-segnam.
if sy-subrc <> 0 .
rollback work .
write: / wa_edidd-docnum .
else.
commit work.
endif.
endloop.
Please help me with the above code .
Regards,
RachelHello Rachel
You could do this the following way:
DATA: ls_edidd TYPE edidd,
ld_idx TYPE i.
FIELD-SYMBOLS:
<ls_segment> TYPE any,
<ld_field> TYPE any.
LOOP AT it_edidd INTO ls_eddid
WHERE ( segnam = wa_ztable-idoc_segment ).
ld_idx = syst-tabix.
ASSIGN ls_edidd-sdata TO <ls_segment> CASTING TYPE (ls_edidd-segnam). " <<<
ASSIGN COMPONENT wa_ztable-field3 OF STRUCTURE <ls_segment>
TO <ld_field>.
<ld_field> = wa_ztable-field4.
MODIFY it_edidd FROM ls_edidd INDEX ld_idx.
ENDLOOP.
However, be aware that your logic might fail in case of repetitive segments.
Regards
Uwe -
Dear All,
I am new to IDOCs. Can someone tell me how to find exit for a segment in IDOC.
Regards,
AnuragHi,
There is no segment exit. If you want populate data and for that there is no corresponding fields in the standard segment, then create the new ZSEGMENT in WE31 with your fields and data element.
Now if u want to send data in those fields through idoc then
1) Go to we30 - Select the radio button extension and then add segments which you created to populate the values.
2) Link the idoc type with message type and add extension ( that u created in WE30)
3) In we20 add the message type used in outbound
4) Identify the suitable user exit and write the code in outbound system (sending system) to populate data in idoc
5) identify the suitable user exit and write code in inbound system to post data from idoc to the database table.
Now replicate data and check whether your are able to insert data in custom fields. -
How to Read Idoc - Segment fields values and status messages
Hi,
I am having one requirement as i want to read the segments along with the field values and also i want to read all the status messages.
first i read the idoc data from EDIDS and segments data from EDID4 and the staus messges from T100. but still i am not getting all the status messages.
is there any other table which contains the information of IDOC segments and field values and also the status messages.
Regards,
KumarYou need to use
V_MSGNO = EDIDS-STAMNO.
CALL FUNCTION 'MESSAGE_PREPARE'
EXPORTING
MSG_ID = EDIDS-STAMID
MSG_NO = V_MSGNO
MSG_VAR1 = EDIDS-STAPA1
MSG_VAR2 = EDIDS-STAPA2
MSG_VAR3 = EDIDS-STAPA3
MSG_VAR4 = EDIDS-STAPA4
IMPORTING
MSG_TEXT = V_TEXT.
WRITE: / V_TEXT.
a®
Maybe you are looking for
-
How to access SAMLIdentityAsserter (V2)
Hi I would like to access a specific SAMLIdentityAsserter from within my ServletFilter. I want to read special attributes from this SAMLIdentityAsserter to build up my own SAML request. Does anyone knows how I can access this Module, I know I should
-
I can't import aiff files into itunes as mp3s
I am trying to add some aiff files from an external hard drive to my itunes library. My import settings have mp3 checked under the advanced preferences and I am using the File>add to library command. When the files show up in my itunes library, they
-
Hi, I have been working as system engineer for almost seven years. My primary focus is on Windows Server 2008 R2/2012 R2 technologies, Exchange Server 2010/2013, PowerShell (v2, v3 and v4), SCCM/SCOM 2012 R2, MDT 2012 U1/2013, IIS 8/8.5 and list goes
-
How to use Pl/sql block to edit check user input
Hi, Please advise on PL/SQL Block code that could be used to Check User input from within a Loop and proceed conditionally based upon User Supplied compliant Input. Thanks in advance.
-
Airport won't connect to the internet anymore after unusual reset
About a month ago, I was using my Mac normally. Then one time when I had it on, it just resetted by itself. I don't know how. I don't know why, but it resetted. It turned off by itsel. Anyway. I turned it back on, and then I found out I could no long