2011 Jan 12 1:31 PM
Hi Gurus!,
I'm running into the following problem here. I want a line of a structure, referenced to PTEX2010, to be moved to an idoc segment (edidd-sdata to be exact).
But everything I tried resulted in hash key (#) error output in the idoc sdata field where I am expecting values. It seems to go wrong/being messed up when moving fields typed P.
Here's the sample proggie I work with
report zron_test_idoc.
types: begin of ty_2010.
include structure ptex2010.
types: end of ty_2010.
data: it_2010 type table of ty_2010.
data: wa_2010 like line of it_2010.
data: t_idoc_data_line type edidd.
data: t_idoc_data type table of edidd.
data: l_sdata type edi_sdata.
data: wa_2222 type string.
field-symbols: <x_struc_2000> ,
<x_struc_2010> type c .
start-of-selection.
break-point.
t_idoc_data_line-segnam = 'Z1PTEX2010'.
t_idoc_data_line-mandt = sy-mandt.
assign wa_2010 to <x_struc_2010> casting .
t_idoc_data_line-sdata = <x_struc_2010>.
append t_idoc_data_line to t_idoc_data.
end-of-selection.
write: t_idoc_data_line-sdata+300(200).
This is just an example. When you run it you can see the ## # tags where I expected a value. Any ideas how to tranport the work area correctly formatted to the idoc-sdata?
thanks,
Ron.
2011 Jan 12 4:10 PM
Hi Ron,
IDOCs are used for data exchange between systems. All segment fields in all IDOCs are defined as pure character fields, the content id pure ASCII . A type P field does not follow any compatible syntax, the representation is not ASCII.
If you want to use IDOC, you can define a segment type with all required fields of PTEX2010 as CHAR with sufficient size. Then you can MOVE-CORRSPONDING PTEX2010 to <IDOC-segment.> and SDATA = <IDOC-segment.>
Regards,
Clemens
P.S.: Created 2 hours before...
Hi Ron,
IDOCs are used for data exchange between systems. All segment fields in all IDOCs are defined as pure character fields, the content id pure ASCII . A type P field does not follow any compatible syntax, the representation is not ASCII.
If you want to use IDOC, you can define a segment type with all required fields of PTEX2010 as CHAR with sufficient size. Then you can MOVE-CORRSPONDING PTEX2010 to <IDOC-segment.> and SDATA = <IDOC-segment.>
Regards,
Clemens
P.S.: Created 2 hours before...
2011 Jan 12 2:56 PM
Check the following code :
data: t_idoc_data_line type edidd,
t_idoc_data type table of edidd.
data wa_z1ptex2010 type Z1PTEX2010.
*Populate the Z1PTEX2010 segment
wa_z1ptex2010-field1 = .........
..........................................
........................................
t_idoc_data_line-sdata = wa_z1ptex2010.
t_idoc_data_line-segnam = 'Z1PTEX2010'.
append t_idoc_data_line to t_idoc_data.
2011 Jan 12 3:00 PM
Use the corresponding DDIC structure for your segment definition, then move that work area to SDATA. See any of the outbound process code examples in the system. You don't need the field symbols...
2011 Jan 12 4:10 PM
Hi Ron,
IDOCs are used for data exchange between systems. All segment fields in all IDOCs are defined as pure character fields, the content id pure ASCII . A type P field does not follow any compatible syntax, the representation is not ASCII.
If you want to use IDOC, you can define a segment type with all required fields of PTEX2010 as CHAR with sufficient size. Then you can MOVE-CORRSPONDING PTEX2010 to <IDOC-segment.> and SDATA = <IDOC-segment.>
Regards,
Clemens
P.S.: Created 2 hours before...
2011 Jan 12 4:14 PM
Exactly the case Clemens,
We discovered that the Z.. segment of the idoc also had type references that contained P! So that's not allowed as well.
After changing the segment-types from P to C AND changing the program a little it worked like a charm.
thanks all for your contributions!
cheers,
Ron.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |