How to fill data in idoc

Hi experts,
Could u please give some sample codes for filling data into idoc.

Hi Nisha,
Go through this userdefined program u can understand .
*& Report  ZBT_SEL_PROGRAM                                             *
REPORT  zbt_sel_program                         .
TABLES: mara.
              Data declaration
*--Material number selection.
SELECT-OPTIONS: s_matnr FOR mara-matnr.
PARAMETERS:
*--Rec.Partner
   p_rcvprn TYPE edi_rcvprn,
*--Message type
   p_msgtyp TYPE edi_mestyp.
              Internal table declaration
DATA:
*--MARA data
      it_mara TYPE STANDARD TABLE OF mara WITH HEADER LINE,
*--To fill the segment Z1MARM
      it_temp_mara TYPE STANDARD TABLE OF z1marm WITH HEADER LINE,
*--MAKT data
      it_makt TYPE STANDARD TABLE OF makt WITH HEADER LINE,
*--To fill the segment E1MAKTM
      it_temp_makt TYPE STANDARD TABLE OF e1maktm WITH HEADER LINE.
DATA: st_edidd TYPE STANDARD TABLE OF edidd WITH HEADER LINE,
      st_comm_cont TYPE STANDARD TABLE OF edidc WITH HEADER LINE,
      st_mast_cont TYPE edidc.
*--Fetch the data from MARA table
SELECT * FROM mara INTO TABLE it_mara WHERE matnr IN s_matnr.
IF sy-subrc = 0.
  SORT it_mara.
ENDIF.
*--Fetch the data from MAKT table
IF NOT it_mara[] IS INITIAL.
  SELECT * FROM makt INTO TABLE it_makt FOR ALL ENTRIES IN it_mara
                    WHERE matnr = it_mara-matnr.
  IF sy-subrc = 0.
    SORT it_makt.
  ENDIF.
ENDIF.
*--Fill the iternal tables which is type the same of Segments
LOOP AT it_mara.
  MOVE-CORRESPONDING it_mara TO it_temp_mara.
  APPEND it_temp_mara.
  CLEAR it_temp_mara.
ENDLOOP.
LOOP AT it_makt.
  MOVE-CORRESPONDING it_makt TO it_temp_makt.
  APPEND it_temp_makt.
  CLEAR it_temp_makt.
ENDLOOP.
*--Fill the segments
LOOP AT it_temp_mara.
  st_edidd-segnam = 'Z1MARM'.
  st_edidd-sdata = it_temp_mara.
  APPEND st_edidd.
  CLEAR st_edidd.
ENDLOOP.
LOOP AT it_temp_makt.
  st_edidd-segnam = 'E1MAKTM'.
  st_edidd-sdata = it_temp_makt.
  APPEND st_edidd.
  CLEAR st_edidd.
ENDLOOP.
*--Fill Master IDOC
st_mast_cont-rcvprt = 'LS'.
st_mast_cont-rcvprn = p_rcvprn.
st_mast_cont-mestyp = p_msgtyp.
st_mast_cont-idoctp = 'ZMATMAS01'.
*--Create the communication IDOC by passsing master IDOC and control
information.
CALL FUNCTION 'MASTER_IDOC_DISTRIBUTE'
  EXPORTING
    master_idoc_control                  = st_mast_cont
  OBJ_TYPE                             = ''
  CHNUM                                = ''
  TABLES
    communication_idoc_control           = st_comm_cont
    master_idoc_data                     = st_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 sy-subrc = 0.
*--Commit work
  COMMIT WORK.
ENDIF.
*--Display IDOC Number.
LOOP AT st_comm_cont.
  WRITE: 'IDOC Numbers:',st_comm_cont-docnum.
ENDLOOP.
Rewards some points.
Rgds,
P.Naganjana Reddy

Similar Messages

  • IDOC: How to fill data for sub segments ?

    Hi,
    I have 3 segments, segA , segB , segA1 . segA1's parent segment is segA . segA and segB are at the same level .
    How to fill data for segA1  ? can you give some sample code ?
    Thanks a lot !

    hi,
    You can fill the segment in the sequence in the idoc either parent or child.
    In you case first fill parent segment SEGA next SEGA1. Then you can fill the SEGB.(If segB is deifned as next segment of segA in the idoc structre)
    Thanks and regards,
    shyla kumar

  • How to read data from idoc to internal table?

    Hi
    How to get data from idoc segments to internal table?

    Hi
    Check this ex
    The following coding sample, shows how you may read a MATMAS IDoc and extract the data for the MARA and MARC segments to some internal variables and tables.
    DATA: xmara LIKE mara.
    DATA: tmarc LIKE marc
                OCCURS 0
                WITH HEADER LINE.
    LOOP AT edidd.
       CASE edidd-segnam.
         WHEN 'E1MARAM'.
              MOVE edidd-sdata TO xmara.
         WHEN 'E1MARCM'.
           MOVE edidd-sdata TO tmarc.
              APPEND tmarc.
       ENDCASE.
    ENDLOOP.
    now do something with xmara and tmarc.
    hope this helps you...
    Reward points if useful..
    Regards
    Sreenivas

  • How to fill data  for asset accoutning datasources

    hi gurus
    i want to know how to fill data for the FI:asset accounting data sources.As these datasources are not related to Logistics,i think filling setuptables concept doesnot come into picture here.thenhoe to  fill data for the datasources:0FI_AA_001,0FI_AA_005,0FI_AA_006
    Pls give me some inputs ASAP
    Its very Urgent
    Thanks in Advance
    Surya Reddy

    Hi,
    Asset Accounting works with Timestamp mechanism.  No Setup table concept like logistics.  Find the prerequisites for AA extraction.
    For Asset Accounting Delta Extraction you first need to have this BADI - FIAA_BW_DELTA_UPDATE active in the system:
    Check the link below for more details about the badi and the delta extraction procedure.
    http://help.sap.com/saphelp_nw04/helpdata/en/a8/f4153c4eb5d82ce10000000a114084/frameset.htm
    Sequence of Data Requests
    For summarization of line items by master record characteristics (such as cost center) during posting of ODS objects to Info Cubes, master data must already exist prior to extraction of transaction data.
    Also the following sequence must therefore be kept to during extraction:
    1. 0FI_GL_4 General Ledger: line items (if required)
    2. 0ASSET_ATTR_TEXT Asset sub number (flexible updating)
    3. 0ASSET_AFAB Depreciation area real or derived
    Then the transaction data
    0FI_AA_11 FIAA: transactions and / or
    0FI_AA_12 Posted depreciations (period values)
    Hope it helps
    Regards
    Srikanth

  • How to fill data in to extended idoc segments  for outbound program

    Hi all,
    I am new to this Community In the extension of  Standard idoc INVOIC02  with some custom segments like zemail, zfax,,,,how to fill the data into both standard segments and custom segments for outbound idoc using exit EXIT_SAPLVEDF_002 of standard function module IDOC_OUTPUT_INVOIC...
    i need some sample code
    THANKS
    PAVAN K

    Hi all,
    I am new to this Community In the extension of  Standard idoc INVOIC02  with some custom segments like zemail, zfax,,,,how to fill the data into both standard segments and custom segments for outbound idoc using exit EXIT_SAPLVEDF_002 of standard function module IDOC_OUTPUT_INVOIC...
    i need some sample code
    THANKS
    PAVAN K

  • How to fill data in a table automatically

    Hello Experts,
    I would like to know if its possible to fill data in a table by looping.
    I have the following table:
    Draws(
    NUM NUMBER,
    START_DATE DATE NOT NULL,
    END_DATE DATE NOT NULL,
    ACTIVE CHAR(1 BYTE) DEFAULT 'Y')
    Now my table should contain the foll:
    Num start_date end_date active
    1 23/01/2010 21:00:00 30/01/2010 19:00:00 Y
    2 30/01/2010 21:00:00 06/02/2010 19:00:00 Y
    I have an initial start date and the end_date is always (start_date + 7) and the next start date starts with the previous end_date but time changes from 19:00 to 21:00.
    Is there a way i can enter those values on a weekly basis???
    Thanks
    Edited by: Kevin CK on Jul 5, 2010 3:07 AM

    there are a number of ways to do weekly inserts. it just depends on your environment and what you want to manage.
    1. write a PL/SQL procedure to do the periodic insert. i assume you know how to do this since you only asked about doing the insert weekly.
    2. options for running the procedure weekly:
    a. using your OS job scheduler, schedule a batch job to run a sql script to execute the procedure.
    b. inside the Oracle database, use DBMS_SCHEDULER (or DBMS_JOB if you are on a version older than 10g) to run the procedure.
    c. write yourself a reminder on a sticky note to run the procedure each week, post it on your computer, and run it manually.
    if you need more details, just say so.

  • How to fill data when call function of sap standard script form?

    Hi every experts,
    <Priority Normalized>
    In our system, when we log in 'FR', we can print purchase order in language Franch,in t_code:ME22N.  And when logging in 'EN', we can print it in language English, in ME22N. The English form is just only translated from Franch, with all same structure and frame.  The form is done by script form.
    And when logging in 'ZH', we create a new program, calling function smartform, instead of translating from EN language. Because of different structure and frame, I don't know the way to write script, so  I print puchase order by smartform, when logging in 'ZH'.
    But I have a new issue. Our MM module consultant needs me to print Chinese form if one condition, print English form in other condition.
    So I have no idea to solve it. Because in my program, I get data to fill smartform and call function of smartform. And I don't know how to get data to fill script form. I only know the function name, 'OPEN_FORM' 'WRITE_FORM' 'CLOSE_FORM'.....
    If I only call the several functions, I will get only frame without no data. So who can tell me how to do????
    <Urgency downgraded>
    Edited by: Suhas Saha on Jul 26, 2011 3:34 PM
    Edited by: Vinod Kumar on Jul 26, 2011 4:09 PM

    Hi,
    Normally if we look in NACE transaction, you can see that upto five different FORMS can be assigned to a single output type . i.e. for each form there will be a seperate routine through which it gets called. But it all start from the first form only.
    so you need to write your code in the ENTRY of the first form and if it does not satisfy do not go for processing of it but just exit of that form ENTRY. so that it will take you to next form.
    hope this helps.
    Thanks,
    Venkatesh

  • How to upload data using idoc in lsmw

    plz let me know how to upload material using idoc using lsmw. urgent

    Hi Vrishali,
    refer to the link below:
    http://www.****************/Tutorials/LSMW/IDocMethod/IDocMethod1.htm
    Hope this helps.
    Reward if helpful.
    Regards,
    Sipra

  • How to fill data in PDF form?

    Hi All,
    I have a pdf forms(about 100). Now I need to open that forms in the browser. User can fill that form and that data should be filled in the database/XML file. Then when user come again then that form details must be displayed in that form.
    Please suggest me some path as I am totally blank about this concept.
    Regards.

    Hi Leonard,
    Thank you very much for the reply.Our users have only reader at their side. Can we set up any kind of software implementation at server side? Or with the use of the .NET(C#) ?
    Can you please provide me some link to initiate this project? Actually I don't know how to start this.
    Any help would be appreciated.

  • How to fill data in BusinessPartner - Role Employee - Tab Identification

    Hi Experts!
    My Program creates a new BP with BAPI_BUPA_CREATE_FROM_DATA.
    After that I create the role 'employee' with BAPI_BUPA_ROLE_ADD_2.
    In the role employee there is the tab 'Identification' with a block 'personal data' and 'employee data'
    how the hell could I fill these two blocks with data (especially the block 'employee data')
    thanks for your help in advance!
    regards franz

    Did you finally find out how to populate the additional enhance parametes of segment E1BPEXTC in the HR sending system?.
    I would need to implement the same scenario.
    Thanks in advance.

  • How to Retrive data from IDOC

    hi!
    I have two different application servers say 100 & 200.
    I have created IDOC in client 100 and its status says - IDOC ready for despatch.
    can anybody say me whats the next step i have to do, how to retrieve the data stored in IDOC of client 100 into client 200.
    used RFC to generate IDOC.
    Kindly help me.
    Regards
    Kv

    hi! Gaurav
    Thanks for your reply.
    Can you explain how to establish the connection between the clients.
    Is it through SM59.
    I have followed the steps in Client 100 which is a sender
    Logical Systems
    Message Type
    SM59 - Client Assignment
    Segment Creation
    BD64 - Distribution Model Creation
    Generated Profile
    SE37 - RFC Creation for IDOC
    WE02 - IDOC - Status "Ready To Despatch"
    Client 200 - Receiver
    Logical system
    Message Type
    SM59 Client Assignment
    Segment Creation
    Now how to call the RFC created in  Client 100.
    Can you explain me to Establish the connection between 100 & 200 clients
    Regards
    Kv

  • How to fill date key figure with system date?

    Dear All,
    We would like to set on specific action (button press) to assign current system date top a date key figure within our infocube.
    Any idea how to achieve this?many thanks in advance for any idea!
    Kind Regards
    Olivier DESFOUR

    Dear Khaja,
    I'm not exactly using an update rule, i'm using Integrated Planning component.
    Customer would like to set this key figure on user action; ie for example
    user validate a step within planning process by pressing a button on workbook.
    then system is stamping system date within cube.
    Hope it helps
    Kind regards
    Olivier

  • How to extract data from idocs and store to target

    I recently started on BODS project, i am really not sure how does teh idocs work.
    Is the sap r3 produces Idocs and the bods need to perform the ETL on idocs? or is it the otherway?
    Thank you very much for the helpful info.
    Kind regards.

    hi,
    Not sure if this helps but give a try
    you can create connection from EAS to SAP .. using a plug-in .. if you have access to oracle Support go for [ID 968961.1]
    or
    below are steps
    1. In EASPATH\console, open components.xml in a text editor.
    2. Under <PluginList>, enter <Plugin archiveName="SAP" packageName="com.essbase.eas.sap.ui"/> before the closing </PlugIn> tag.
    3. Save and close the file.
    4. In EASPATH\console\bin, open admincon.lax in a text editor.
    5. Search for lax.class.path= and append ;..\lib\sap_client.jar;..\lib \sap_common.jar to the entry. Save and close the file.
    6. In EASPATH\server\bin, open adminsvr.lax in a text editor.
    7. Search for lax.nl.java.option.additional, and append -DRFC_INI=EASPATH\server\saprfc.ini. Save and close the file.
    8. Create a new environment variable, RFC_INI, with a value of EASPATH\server\saprfc.ini
    9. Copy librfc.dll andsapjcorfc.dll to EASPATH\server\bin. You may need to obtain these files from SAP.
    let me know if it works :)

  • How to fill data to inputfield?

    Hi,
    I have 2 inputfield, which get from the dictionary at Graphical Screen Painter. eg. Name and Contact Number.
    The Name have Search help function, which allow me to choose the value for the Name inputfield without manually input. I need to populate the contact number base on the value selected in the search help. How do i go about it?
    Regards,
    Rayden

    Hi ..
    Check this Code .. it should help.
    Change the Same code as per Module pool.
    ***Function modules related to Search Helps In POV event..
    F4IF_INT_TABLE_VALUE_REQUEST
    F4IF_FIELD_VALUE_REQUEST
    F4UT_PARAMETER_VALUE_GET
    F4UT_PARAMETER_RESULTS_PUT
    F4IF_SHLP_EXIT_EXAMPLE.
    How to Generate F4 Help in Screens POV
    REPORT zsel_f4help .
    *---Report with selection screen and to display the list of
    possible entries for field 'B' as per the value in field 'A'.
    PARAMETERS: p_vbeln TYPE vbak-vbeln,
    p_posnr TYPE vbap-posnr.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_posnr.
    DATA: BEGIN OF help_item OCCURS 0,
    posnr TYPE vbap-posnr,
    matnr TYPE vbap-matnr,
    arktx TYPE vbap-arktx,
    END OF help_item.
    DATA: dynfields TYPE TABLE OF dynpread WITH HEADER LINE.
    dynfields-fieldname = 'P_VBELN'.
    APPEND dynfields.
    **Read the Values of the SCREEN FIELDs
    CALL FUNCTION 'DYNP_VALUES_READ'
    EXPORTING
    dyname = sy-cprog
    dynumb = sy-dynnr
    translate_to_upper = 'X'
    TABLES
    dynpfields = dynfields
    EXCEPTIONS
    invalid_abapworkarea = 1
    invalid_dynprofield = 2
    invalid_dynproname = 3
    invalid_dynpronummer = 4
    invalid_request = 5
    no_fielddescription = 6
    invalid_parameter = 7
    undefind_error = 8
    double_conversion = 9
    stepl_not_found = 10
    OTHERS = 11.
    **Find out the Value of P_VBELN
    READ TABLE dynfields WITH KEY fieldname = 'P_VBELN'.
    p_vbeln = dynfields-fieldvalue.
    **Convert the Value into internal format
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
    EXPORTING
    input = p_vbeln
    IMPORTING
    output = p_vbeln.
    **Fetch the correponding itemnos from VBAP
    SELECT posnr matnr arktx INTO TABLE help_item
    FROM vbap
    WHERE vbeln = p_vbeln.
    **Generate the F4 help with internal table values
    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
    retfield = 'POSNR'
    dynprofield = 'P_POSNR'
    dynpprog = sy-cprog
    dynpnr = sy-dynnr
    value_org = 'S'
    TABLES
    value_tab = help_item.
    reward if Helpful.

  • How to fill dates through a formular

    Dear all,
    I have created a Dashboard where the user is able to introduce 4 parameters:
    -login
    -password
    -timestart (start, i.e: 00:00:00)
    -timestop (stop, i.e: 12:00:00)
    Through these parameters, a DDBB is loaded like this:
         ActiveDocument.Sections["Query"].DataModel.Connection.Open(v_ddbb);
         ActiveDocument.Sections["Query"].DataModel.Connection.Username = v_user;
         ActiveDocument.Sections["Query"].DataModel.Connection.SetPassword(v_password);
         ActiveDocument.Sections["Query"].Limits["Time"];.CustomValues.Add(v_timestart);
         ActiveDocument.Sections["Query"].Limits["Time"];.CustomValues.Add(v_timestop);
         ActiveDocument.Sections["Query"].Limits["Time"];.SelectedValues.AddAll();
         ActiveDocument.Sections["Query"].DataModel.Connection.Connect();
         ActiveDocument.Sections["Query"].Process();
         ActiveDocument.Sections["Query"].DataModel.Connection.Disconnect();
    After some tests, I have found out that in the Filter "Time" I have cumulated a lot of different values, as many as test I made. How could I delete the existing ones and then add the new ones [CustomValues.Add]?
    Many thanks in advance.

    Hello,
    Thank you for your help.
    Unfortunately, it does not work properly because indeed your command instruction deletes my limits, but afterwards I am not able to add the new limit:
    TLimit=ActiveDocument.Sections["Query"].Limits["timestamp"]
    ActiveDocument.Sections["Query"].Limits.RemoveAll(); //your command
    TLimit.CustomValues.Add(v_timestart);
    TLimit.CustomValues.Add(v_timestop);
    TLimit.SelectedValues.AddAll();
    Thany you in advance!!

Maybe you are looking for

  • Satellite A300-1NO - Wakes up from standby mode

    Hi all! I have got a Satellite A300-1NO with Win XP pro. The problem is, that the laptop wakes up from standby mode automatically after about 5 minutes. I tried to unplug all cables (LAN, usb, etc) but the power plug, but it's the same result. So wha

  • Service entry tables

    Hi Gurus, i have an issue in finding out the cumulative qty in the service entry sheet i have Service entry sheet smartform developed,in that cumulative qty i ahve give the Field ACT_MENGE against the entry sheet number,but this value is changing aft

  • Restrict access to Dynamics CRM 2015 to only company laptops or Ipads

    Dear all, I have deployed MS Dynamics CRM 2015 server on premise and I want to restrict access to company laptops only. All company laptops are joined to my domain. Any guide/help would be greatly appreciated. Many Thanks & Regards Vinay

  • MacBook Pro camera not found/working

    I am using system 10.7.5 (I have CS6 and worry that upgraded software will not work with apps I use to make a living)...and ALL my apps: Skype, Photobooth, Facetime will not work and say, no camera detected. I have not used skype in several months, a

  • Changing password of WIFI Controller user

    Hi, I have a CISCO 2100 Series Wireless controller. for accessing this controller one "admin" user is created. I want to change the password og this controller. Kidly suggest how can we change. Thanks Kumar Amit