Application Development 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: 

Process a manually created Idoc

Former Member
0 Kudos

Hi All,

I need to extend an Idoc. But this is a generated idoc, so I can not extend it. Hence I need to copy this Idoc. Now how will I process this IDoc?

Please help.

Regards,

Jeetu

1 ACCEPTED SOLUTION

Former Member
0 Kudos

hi jeetu

i have one very good doc for idocs which can probably solve ur prob,

plz give ur mail id i will send it to u

regards

ravish

5 REPLIES 5

former_member235056
Active Contributor
0 Kudos

Hi,

Go through this document link:

<a href="http://abapcode.blogspot.com">http://abapcode.blogspot.com</a>

Pls reward helpful points.

Regards,

Ameet

former_member181962
Active Contributor
0 Kudos

YOu can test your IDOCs using WE19 transaction. YOu can add, delete modify the values in the segments.

For extending IDOC types, visit this link:

http://help.sap.com/saphelp_nw04/helpdata/en/dc/6b7d6243d711d1893e0000e8323c4f/frameset.htm

Regards,

Ravi

Former Member
0 Kudos

Hi,

This is what you can do.

Just go to WE19,give the idoc number of the already processed idoc and press F8.

Now you can manually process the idoc using the idoc function module and it will create a new idoc.

Hope it is useful.

Thanks,

Sandeep.

Former Member
0 Kudos

hi



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', " message type
  C_DOCTYP TYPE EDIDC-IDOCTP VALUE 'ZVISTAPM01'," idoc type
  C_SEGNAM TYPE EDIDD-SEGNAM VALUE 'Z1VISTAPM'."segment name
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>reward if useful</b>

Former Member
0 Kudos

hi jeetu

i have one very good doc for idocs which can probably solve ur prob,

plz give ur mail id i will send it to u

regards

ravish