Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

IDOC

Former Member
0 Likes
318

Hi all

I have extended a basic IDOC type to a Z type. The problem i am facing is i am not able to see all the fields in WE02 , even if the basic IDOC type has a number of fields in the segments.

Is there some setting in the system to choose the fields which we want to transmit ?

Thanks and Regards

Nitin Khurana

Hi all

I have extended a basic IDOC type to a Z type. The problem i am facing is i am not able to see all the fields in WE02 , even if the basic IDOC type has a number of fields in the segments.

Is there some setting in the system to choose the fields which we want to transmit ?

Thanks and Regards

Nitin Khurana

1 REPLY 1
Read only

Former Member
0 Likes
298

hi

if u have created ur own segment have u associated extended idoc type to it???

if yes, where are u populating ur idoc.

u will have to create a zfunction module in we20 and write the code for populating ur idoc there.

on;y then u will be able to see all the fields. here is the sample code for outbound processing of the idoc. just refer to it.



Creation of an IDoc generation program
The following code extract contains everything needed to generate an IDoc from data contained in a table.
FORM F_110_SEND_IDOC.
CONSTANTS:
  C_MESTYP TYPE EDIDC-MESTYP VALUE 'ZVISTAPM',
  C_DOCTYP TYPE EDIDC-IDOCTP VALUE 'ZVISTAPM01',
  C_SEGNAM TYPE EDIDD-SEGNAM VALUE 'Z1VISTAPM'.
DATA:
  I_ZVISTA_PM TYPE ZVISTA_PM_T OCCURS 6000,
  I_EDIDC TYPE EDIDC OCCURS 0,
  I_EDIDD TYPE EDIDD OCCURS 0,
  WA_ZVISTA_PM TYPE ZVISTA_PM_T,
  WA_EDIDC TYPE EDIDC,
  WA_EDIDD TYPE EDIDD,
  WA_Z1VISTAPM TYPE Z1VISTAPM,
  V_OCCMAX TYPE IDOCSYN-OCCMAX,
  V_NBSEG TYPE I.
CLEAR WA_ZVISTA_PM.
CLEAR WA_EDIDC.
* Save the message type and the basic IDoc type
* in the control segment
MOVE C_MESTYP TO WA_EDIDC-MESTYP.
MOVE C_DOCTYP TO WA_EDIDC-IDOCTP.
* Retrieve the maximum number of segments in the basic IDoc
* type
SELECT MIN( OCCMAX )
  FROM IDOCSYN
  INTO V_OCCMAX
  WHERE IDOCTYP EQ C_DOCTYP AND SEGTYP EQ C_SEGNAM.
* Save the whole ZVISTA_PM_T table content
* in the I_ZVISTA_PM internal table.
SELECT *
FROM ZVISTA_PM_T
INTO CORRESPONDING FIELDS OF TABLE I_ZVISTA_PM.
* Create a data segment for each line of I_ZVISTA_PM
LOOP AT I_ZVISTA_PM INTO WA_ZVISTA_PM.
  MOVE-CORRESPONDING WA_ZVISTA_PM TO WA_Z1VISTAPM.
  CLEAR WA_EDIDD.
  MOVE C_SEGNAM TO WA_EDIDD-SEGNAM.
  MOVE WA_Z1VISTAPM TO WA_EDIDD-SDATA.
  APPEND WA_EDIDD TO I_EDIDD.
  CLEAR WA_ZVISTA_PM.
  CLEAR WA_Z1VISTAPM.
ENDLOOP.
* Count the number of data segments
DESCRIBE TABLE I_EDIDD LINES V_NBSEG.
* If the number of data segments exceeds the maximum
* allowed number, then edit a message in the spool,
* then display an error message (quit the program)
IF V_NBSEG GT V_OCCMAX.
  WRITE:/ TEXT-003, V_OCCMAX.
  MESSAGE E751.
ENDIF.
* Call the IDoc creation function
CALL FUNCTION 'MASTER_IDOC_DISTRIBUTE'
  EXPORTING
    MASTER_IDOC_CONTROL = WA_EDIDC
  TABLES
    COMMUNICATION_IDOC_CONTROL = I_EDIDC
    MASTER_IDOC_DATA = I_EDIDD
  EXCEPTIONS
    ERROR_IN_IDOC_CONTROL = 1
    ERROR_WRITING_IDOC_STATUS = 2
    ERROR_IN_IDOC_DATA = 3
    SENDING_LOGICAL_SYSTEM_UNKNOWN = 4
    OTHERS = 5.
* If there was an error, display a message (quit the
* program)
IF SY-SUBRC NE 0.
  MESSAGE E746.
ENDIF.
ENDFORM.

regards

ravish

<b>plz dont forget to reward if helpful</b>