Multiple lines appended in mail body while using SO_NEW_DOCUMENT_SEND_API1.

Hi,
I built the text(Body) of the mail with 19 lines. But while triggering through workflow the last 3 lines of the body displayed in the same line instead of different line. I used SO_NEW_DOCUMENT_SEND_API1 function module for mail sending activity,
Can anybody experienced this kind of problems earlier? If so please kindly help me to sort out this asap. Useful responses will be rewarded.
Thanks in advance.

Hi
I have used this function module to send mail.
SO_NEW_DOCUMENT_SEND_API1
I have not problem and not found any duplicate entries.
Please send your piece of code where you are adding text line.
It may happened because of not clearing the memory values.
Rgds,
Sriram

Similar Messages

  • No Mail Body while using FM SO_DOCUMENT_SEND_API1 in WD Component

    Hi All,
    I am using  FM 'SO_DOCUMENT_SEND_API1' in a WD Component for sending mails.
    First of all i just to know can we use this FM without Attachment ???
    As i just have to send mail without any attachment.
    The Mail is properly send  but without any body .
    I mean there is no content in the mail body .
    There is no error in the FM but when i check the mail (for checking myself) ,it was blank without any body.
    So please help me for the same.
    Regards,
    Vishal Chauhan

    Hi Priya,
    My problem was solved by using other FM ie. SO_OBJECT_SEND.
    Now I just want to know can we use any hard code email id for sending the mail.
    CALL FUNCTION 'SO_OBJECT_SEND'
            EXPORTING
              object_hd_change = wa_head
              object_type      = 'RAW'
              outbox_flag      = 'X'
              originator = 'SY-UNAME'
              originator_type = 'B'
            TABLES
              objcont          = i_objcontent
              receivers        = i_receiver
            EXCEPTIONS
              OTHERS           = 1.
    I want to Hardcode the sender id  say 'SAPUSER' So that any mail will come from a common ID not from Indivisual id.
    So is there is any Pramametre in this FM where i can hard code the mail id like xyz at y.com
    Regards,
    Vishal Chauhan

  • Create hyperlink for reply to in mail body while sending email.

    Hi All,
    We have a requirement where we need to create an hyperlink for reply to in the mail body.
    We have implemented entire functionality using CL_BCS classes and everything is working fine.
    Only problem we have is when we give document type as HTM instead of RAW then entire formatting of mail body gets disturbed although we get the hyperlink.
    Is there any way where we can send the mail in html format using CL_BCS,CL_DOCUMENT_BCS ?
    KR Jaideep,

    Hi ,
    Please find the code below I am using to make the hyperlink. Do I need to fill the entire mail body using HTML Tags ? If yes, then I guess it will increase the complexity of program as the mail content will vary from one mail to another depending upon whether different invoice documents have text maintained in them.
    lwa_text = '<html>'.
        APPEND lwa_text TO li_text.
        CLEAR lwa_text.
        lwa_text = '<body>'.
        APPEND lwa_text TO li_text.
        CLEAR lwa_text.
        lwa_text = text-012.
        APPEND lwa_text TO li_text.
        CLEAR lwa_text.
        CONCATENATE '<a href="mailto:'
                    lv_receiver
                    '">'
                    lv_receiver
                    '</a>'
               INTO lwa_text.
        APPEND lwa_text TO li_text.
        CLEAR lwa_text.
        lwa_text = '</body>'.
        APPEND lwa_text TO li_text.
        CLEAR lwa_text.
        lwa_text = '</html>'.
        APPEND lwa_text TO li_text.
        CLEAR lwa_text.
        TRY.
            CALL METHOD cl_document_bcs=>create_from_text
              EXPORTING
                i_text         = li_text
                i_documenttype = 'HTM'
                i_subject      = 'Test for hyperlink'
                i_importance   = '1'
                i_sensitivity  = 'P'
              RECEIVING
                result         = lref_document_bcs.
          CATCH cx_document_bcs .
        ENDTRY.

  • How to put mail body while sending Payment Advice Note by mail

    Hi,
    I am sending payment advice form through mail using the BTE 2040.
    Everything is fine and mail is coming properly but mail does not have any body line. It just contains the PDF as an attachment.
    I want to put mail body in that. I have just copied the Script, I have not copied the driver program.
    E.g
    Hello,
    Please find the payment advice note as an attachment.
    Kindly advice how to put mail body in that mail, is there any BTE through which we can put the mail body?
    Kindly help.
    Regards
    Sachin Yadav

    Hi,
    I am sending payment advice form through mail using the BTE 2040.
    Everything is fine and mail is coming properly but mail does not have any body line. It just contains the PDF as an attachment.
    I want to put mail body in that. I have just copied the Script, I have not copied the driver program.
    E.g
    Hello,
    Please find the payment advice note as an attachment.
    Kindly advice how to put mail body in that mail, is there any BTE through which we can put the mail body?
    Kindly help.
    Regards
    Sachin Yadav

  • Need multiple lines in single column of header using alv oops

    Hi
    I am using alv oops in a report.
    I need multiple lines in single column of header.   
    In header of my report i am using 9 columns.
    In the second column i need to split the line
    Notification description/activity/work/activity long text/
    as
    Notification description/
    activity/
    work/
    activity long text/
    Please guide me to achieve this functionality.

    It is not possible to break the column description in the ALV  disply.
    Actually, if you have a longer description in one of the seltext_* field of the fiels catalog, it will automatically display it as a tooltip, if you put the mouse over the heading. In ALV OO, you can explicitly set the tooltip text.
    Also you can get more help on the field pressing F1: If you use DDIC fields, it it automatic, otherwise you can do it as you like.

  • How to craete Multiple lines in Colum name in ALV using OO concept

    Hi All,
    I have devloped an ALV tree Report using OO Concept, and my column names are very big say like 100 characters.So now i want display that text in 3 or 4 lines.Is there any way that text can be wrapped up and displayed on the subsequent line of the cloum name.
    For eg. My requirement is like below.
    The text to be dispalyed:
    Leave balance for the year ending 31st mar 2005
    Display outout column name should look like this
    " Leave balance for the year
      ending 31st mar2005."
    So as you see i want it in two lines or may be more if it can be fixed.
    Let me know if its possible..
    Thanks
    Umang

    Hi Umang
    This is a very common question but unfortunately there is no way to implement column headers having more than one line.
    Regards
    *--Serdar <a href="https://www.sdn.sap.com:443http://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.sdn.businesscard.sdnbusinesscard?u=qbk%2bsag%2bjiw%3d">[ BC ]</a>

  • Yellow/green line on top of screen while using back camera-3rd gen iPad .....explanation?

    When I use my rear facing camera, a line appears atop the top of the screen....and help?

    Try rebooting your iPad.  Press and hold BOTH the power and home buttons at the SAME for about 10 seconds (ignore the red slider to shut down) until the Apple Logo appears, then let go of both buttons and your iPad will restart.  You will not lose any data or settings.  If after you've done this, there is no improvement, it would be advisable to make an appointment at your Apple Store Genius Bar and let them see it.  If found defective, your iPad will replaced on the spot.

  • Append mappings in hashmap while using putAll()

    Hi there...i need to add some mappings to an already existing map ....but the b]putAll()[ function replaces any already existing mappings.
    Is there any other way to append elements in hashmap.Please help.

    Have a read of the Map API documentation here:
    http://java.sun.com/javase/6/docs/api/java/util/Map.html
    Be on the look out for methods that allow you to put a key/value pair into your
    hashmap.
    Of course, if the mappings you want to add are already inside a map you can't use
    putAll(mappingsToAdd). Instead you will have to iterate over the map that contains
    the new mappings, and put them one at a time into your hashmap.

  • Mail not sent using SO_NEW_DOCUMENT_SEND_API1

    Hi,
    I am using report RSCONN01 after the FM SO_NEW_DOCUMENT_SEND_API1 to send email.
    Eg:
    submit rsconn01 with mode = 'INT'
                    with output = 'X'
                    and return.
    But this report gives a popup which is creating a problem.
    Is there any way to suppress this popup or any other report to send emails.
    Thanks.
    Edited by: Thomas on Feb 24, 2009 10:04 AM
    Edited by: Thomas on Feb 24, 2009 10:06 AM

    Hi,
    i do it like this and don't get an popup.
      SUBMIT RSCONN01 WITH MODE   = 'INT'
                      WITH OUTPUT = ' '
                      AND  RETURN.
    Regards, Dieter

  • How to display TEXT more than 500 char in a report as multiple lines.

    Hi Friends,
    i have a requirement like i should display Texts of length more than 500 Characters in a report( ALV LIST) as multiple lines
    I am fetching the data Using FM READ_TEXT
    the output im currently geeting with 150 Char in lenth as a single line
    How we can split the text into multiple lines in a report
    first i would like to know is it possible? if possible please give your valuable suggitions if not is there any alternative way to do this task.
    Thanks & regards
    kumar.

    Hi,
    This is possible but the Solution might not look Standard/Appropriate to you.
    In ALV, you can have Multiple Line Output...There is a Field in the Field Catalogue..called as Row_position...this is by default 0...which means Single row/Line ALV output....You can have this Value in the Range of 0 to 3.......A ALV field with row_position 1, will be displayed in the second line for every record...i.e. you will have multiple line for a single record of ALV.
    In your case......you can use this but you need to split your field in two fields.....but you may end up spliting a single word....but for that also you can design the logic of splitting the Fiel value at SPACE only......
    This may work.......and Sorry if not work......

  • IDOC segment with multiple lines

    Hi,
    I have a requirement where I need to populate the multiple lines in one segment without getting created multiple segment.
    I am generating material with multiple line data in the additional data using MATMAS05 IDOC for segment E1MTXHM but its generating multiple sub segments. I need to have multiple lines in one segment and not multiple segment.
    Please let me know how to achieve multiple lines in one segment.
    Thanks & Regards,
    Rayan

    Hi Subas,
    I haven written any code as I am triggering IDOC through BD10. This is a testing requirement and we need any IDOC irresepective of MATMAS, DEBMAS, CREMAS etc etc which can have multiple lines in a single segemnt.
    Sample IDOC:
    Z2XXXXD000                                       00002300002203CTDI-PA
    90210 Testing Address
    CA
    Beverly Hills
    United States                                                             
    Z2XXXD000                                       00002400002203ON TESTING
    303 308 5319                                                                               
    Z2XXXXC000                                       00002500000102Z004E          
    Actually every IDOC I am generating is getting multiple segment and each segment holding one line and my requirement is that all the lines should be get accomadated in a single segment like the above sample IDOC.
    Actually each segment has segment name and IDOC no. followed by field values but my requirement is within one segment name and IDOC no. all the field values get accomadated. Hope you got the understanding of what my requirement is? Please guide me how to trigger multiple line in a segment.
    Thanks & Regards,
    Rayan

  • How to handle multiple line items in lsmw

    hi all,
    how can i handle multiple line items in lsmw either by using direct input method or BDC recording.
    first preference is Bdc recording in lsmw . can u tell me the steps in detail.
    thanks,
    harini.c

    Hi Harini,
    Check this link.
    BDC - Header with multiple line items.
    Regards,
    Arun

  • Multiple lines in BDC

    Hi,
    I have to deal with multiple lines in BDC.
    I am using the FM READ_TEXT.
    Now I am getting the multiple lines text through above FM in my itab.
    Then I made loop at itab & under this I wrote the screen-fields.
    But I m getting only last value in my screen.
    could anybody will suggest me what I need to do??

    what is the need of using FM read_text ?
    screen fid may not hold all the data of itab.
    Regards
    Prabhu

  • Hw to write txt in mail body using UTL mail when sending mail with attachme

    hi all
    i m using oracle demo mail package to send csv file as attachment to different users its successfull and i can also able to attach text file to it
    but i m unable to write any text in mail body .
    e.g.
    mail body can be--
    hi
    This is test mail.
    Regds
    Sender.
    can anyone suggest some way?

    u can try this code
    this code takes the file from database and attach with mail and also send the body with it
    it works fine.
    CREATE OR REPLACE
    procedure pdf_mail(
    p_sender varchar2, -- sender, example: 'Me '
    p_recipients varchar2, -- recipients, example: 'Someone '
    p_subject varchar2, -- subject
    p_text long, -- text
    p_case_id number,
    p_email_log_id number
    -- p_filename varchar2, -- name of pdf file
    p_blob   blob     pdf file
    ) is
    conn utl_smtp.connection;
    i number;
    len number;
    p_message_part varchar2(32767);
    cursor c1 is
    select file_name,document_pic
    from clm_case_attachments ca,email_log_detail em
    where
    case_id = p_case_id
    and ca.CASE_ATTACHMENT_ID = em.ATTACHMENT_ID
    and em.ACTIVE = 'Y'
    and em.EMAIL_LOG_ID = p_email_log_id;
    BEGIN
    conn := demo_mail.begin_mail(
    sender => p_sender,
    recipients => p_recipients,
    subject => p_subject,
    mime_type => demo_mail.MULTIPART_MIME_TYPE);
    demo_mail.attach_text(
    conn => conn,
    data => p_text,
    mime_type => 'text/html');
    for lp in c1 loop
    demo_mail.begin_attachment(
    conn => conn,
    mime_type => 'application/pdf',
    inline => TRUE,
    filename => lp.file_name,
    transfer_enc => 'base64');
    -- split the Base64 encoded attachment into multiple lines
    i := 1;
    len := DBMS_LOB.getLength(lp.document_pic);
    WHILE (i < len) LOOP
    IF(i + demo_mail.MAX_BASE64_LINE_WIDTH < len)THEN
    UTL_SMTP.Write_Raw_Data (conn
    , UTL_ENCODE.Base64_Encode(
    DBMS_LOB.Substr(lp.document_pic, demo_mail.MAX_BASE64_LINE_WIDTH, i)));
    ELSE
    UTL_SMTP.Write_Raw_Data (conn
    , UTL_ENCODE.Base64_Encode(
    DBMS_LOB.Substr(lp.document_pic, (len - i)+1, i)));
    END IF;
    UTL_SMTP.Write_Data(conn, UTL_TCP.CRLF);
    i := i + demo_mail.MAX_BASE64_LINE_WIDTH;
    END LOOP;
    demo_mail.end_attachment(conn => conn);
    end loop;
    demo_mail.end_mail( conn => conn );
    END;
    /

  • Problem in uploading multiple line items while Creating sales order by BAPI

    Hi experts ,  Im able to create sales order  with one item while using this program, but the problem is  when iam having multiple  items or multiple sales order  , iam not able to createthe line items , though its creating  sales order header , Iam copy pasting my code , please add the additional code to my code to take more than 1 line items ,This is urgent requirement . Points will be rewarded for answers , Thanks in advance
    *& Report  Z_SO_CREATE_BAPI
    REPORT  Z_SO_CREATE_BAPI.
    DATA: i_header TYPE bapisdhd1 occurs 0 with header line.
    DATA: i_details TYPE bapisditm OCCURS 0 WITH HEADER LINE.
    DATA: i_partner TYPE bapiparnr OCCURS 0 WITH HEADER LINE.
    DATA: i_return1 TYPE bapiret2 OCCURS 0 WITH HEADER LINE.
    DATA: i_return2 TYPE bapiret2.
    data : ORDER_HEADER_IN like BAPISDHD1.
    data : ORDER_ITEMS_IN like BAPISDITM occurs 0 with HEADER LINE .
    data : ORDER_ITEMS_INX Like BAPISDITMX occurs 0 with HEADER LINE .
    data : RETURN like BAPIRET2 occurs 0 with header line.
    data : ORDER_PARTNERS like BAPIPARNR occurs 0 with
    header line.
    DATA : ORDER_KEYS LIKE BAPISDKEY OCCURS 0 WITH HEADER
    LiNE.
    data : ORDER_SCHEDULES_IN like BAPISCHDL occurs 0 with
    header line.
    data : ORDER_SCHEDULES_INX like BAPISCHDLX occurs 0 with
    header line.
    data : BEGIN OF TAB OCCURS 0,
           SRNO(4),
            DOC_TYPE like ORDER_HEADER_IN-dOC_TYPE,
            SALES_ORG LIKE ORDER_HEADER_IN-SALES_ORG,
            DISTR_CHAN LIKE ORDER_HEADER_IN-DISTR_CHAN,
            DIVISION like ORDER_HEADER_IN-DIVISION,
           REQ_DATE_H(10),
           PURCH_DATE(10),
           PMNTTRMS LIKE ORDER_HEADER_IN-PMNTTRMS,
           PURCH_NO_C LIKE ORDER_HEADER_IN-PURCH_NO_C,
           ITM_NUMBER like BAPISDITM-ITM_NUMBER,
            MATERIAL   LIKE  ORDER_ITEMS_IN-MATERIAL ,
            PLANT LIKE ORDER_ITEMS_IN-PLANT,
           TARGET_QTY LIKE ORDER_ITEMS_IN-TARGET_QTY,
           ITM_NUMBERX like  ORDER_ITEMS_INX-ITM_NUMBER ,
           MATERIALX   LIKE  ORDER_ITEMS_INX-MATERIAL ,
           CUST_MAT22 LIKE ORDER_ITEMS_IN-CUST_MAT22,
           PLANTX LIKE ORDER_ITEMS_INX-PLANT,
           TARGET_QTYX LIKE ORDER_ITEMS_INX-TARGET_QTY,
           ITM_NUMBER LIKE ORDER_ITEMS_IN-ITM_NUMBER,
           MATERIAL   LIKE  ORDER_ITEMS_IN-MATERIAL ,
            PARTN_ROLE LIKE ORDER_PARTNERS-PARTN_ROLE,
            PARTN_NUMB LIKE ORDER_PARTNERS-PARTN_NUMB,
          END OF TAB.
    DATA: v_vbeln TYPE bapivbeln-vbeln.
    selection-screen begin of block b1 with frame.
    skip 3.
    parameter:p_infile like rlgrap-filename obligatory.
    skip 3.
    selection-screen end  of block b1.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_infile.
      PERFORM value_help.
    start-of-selection.
    CALL FUNCTION 'WS_UPLOAD'
      EXPORTING
        filename                     = p_infile
       FILETYPE                      = 'DAT'
      HAS_FIELD_SEPARATOR           = 'X'
      HEADER_LENGTH                 = 0
      READ_BY_LINE                  = 'X'
      DAT_MODE                      = ' '
      CODEPAGE                      = ' '
      IGNORE_CERR                   = ABAP_TRUE
      REPLACEMENT                   = '#'
      CHECK_BOM                     = ' '
      VIRUS_SCAN_PROFILE            =
      NO_AUTH_CHECK                 = ' '
    IMPORTING
      FILELENGTH                    =
      HEADER                        =
      tables
        data_tab                      = tab.
    EXCEPTIONS
      FILE_OPEN_ERROR               = 1
      FILE_READ_ERROR               = 2
      NO_BATCH                      = 3
      GUI_REFUSE_FILETRANSFER       = 4
      INVALID_TYPE                  = 5
      NO_AUTHORITY                  = 6
      UNKNOWN_ERROR                 = 7
      BAD_DATA_FORMAT               = 8
      HEADER_NOT_ALLOWED            = 9
      SEPARATOR_NOT_ALLOWED         = 10
      HEADER_TOO_LONG               = 11
      UNKNOWN_DP_ERROR              = 12
      ACCESS_DENIED                 = 13
      DP_OUT_OF_MEMORY              = 14
      DISK_FULL                     = 15
      DP_TIMEOUT                    = 16
      OTHERS                        = 17
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    **Validation for the Create SO screen
    *AT SELECTION-SCREEN ON BLOCK na_create.
    Loop at Tab.
    i_header-doc_type =  TAB-DOC_TYPE .
    i_header-sales_org = TAB-SALES_ORG.
    i_header-distr_chan = TAB-DISTR_CHAN .
    i_header-division = TAB-DIVISION .
    append i_header.
    *endloop.
    i_partner-partn_role = TAB-PARTN_ROLE .
    i_partner-partn_numb =  TAB-PARTN_NUMB.
    APPEND i_partner.
    i_details-material =  TAB-MATERIAL .
    APPEND i_details.
    endloop.
    *Bapi for Creating SO
                   CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
                     EXPORTING
                     SALESDOCUMENTIN               = v_vbeln
                       order_header_in               = i_header
                     ORDER_HEADER_INX              =
                     SENDER                        =
                     BINARY_RELATIONSHIPTYPE       =
                     INT_NUMBER_ASSIGNMENT         =
                     BEHAVE_WHEN_ERROR             =
                     LOGIC_SWITCH                  =
                     TESTRUN                       =
                     CONVERT                       = ' '
                    IMPORTING
                      SALESDOCUMENT                 = v_vbeln
                     tables
                      RETURN                        = i_return1
                      ORDER_ITEMS_IN                = i_details
                      ORDER_ITEMS_INX               = ORDER_ITEMS_INX
                       order_partners                = i_partner .
                     ORDER_SCHEDULES_IN            =
                     ORDER_SCHEDULES_INX           =
                     ORDER_CONDITIONS_IN           =
                     ORDER_CONDITIONS_INX          =
                     ORDER_CFGS_REF                =
                     ORDER_CFGS_INST               =
                     ORDER_CFGS_PART_OF            =
                     ORDER_CFGS_VALUE              =
                     ORDER_CFGS_BLOB               =
                     ORDER_CFGS_VK                 =
                     ORDER_CFGS_REFINST            =
                     ORDER_CCARD                   =
                     ORDER_TEXT                    =
                     ORDER_KEYS                    =
                     EXTENSIONIN                   =
                     PARTNERADDRESSES              =
    IF NOT v_vbeln IS INITIAL.
    *Bapi Commit Work
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    EXPORTING
    WAIT =
    IMPORTING
    return = i_return2
    ELSE.
    CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'
    IMPORTING
    RETURN =
    ENDIF.
    LOOP AT i_return1 .  "INTO wa_return1.
    WRITE:/ i_return1-message.
    ENDLOOP.
    FORM value_help .
      CALL FUNCTION 'DSVAS_DOC_WS_FILENAME_GET_50'
        EXPORTING
          DEF_FILENAME     = ' '
          DEF_PATH         = ' '
          MASK             = ',.,..'
          MODE             = 'O'
          TITLE            = ' '
        IMPORTING
          FILENAME         = p_infile
        EXCEPTIONS
          INV_WINSYS       = 1
          NO_BATCH         = 2
          SELECTION_CANCEL = 3
          SELECTION_ERROR  = 4
          OTHERS           = 5.
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    endform.
    txt file data
    order type  salesorg   distch      divison       materialno                  parter role
    TA     PB01     01     00     000000000000000852     WE
    Partner no
    8101000000

    Hi Neerja,
    you can reffer this sample code. It may not be complet soluation for your poblem,
    but you will get some idea.
    *& Report  ZBAPI_SALESORDER_CREATE
    *& Author : Karthik
    REPORT  ZBAPI_SALESORDER_CREATE.
    data : ORDER_HEADER_IN like BAPISDHD1.
    data : ORDER_ITEMS_IN like BAPISDITM occurs 0 with
    header line.
    data : RETURN like BAPIRET2 occurs 0 with header line.
    data : ORDER_PARTNERS like BAPIPARNR occurs 0 with
    header line.
    DATA : ORDER_KEYS LIKE BAPISDKEY OCCURS 0 WITH HEADER
    LINE.
    data : ORDER_SCHEDULES_IN like BAPISCHDL occurs 0 with
    header line.
    data : BEGIN OF TAB OCCURS 0,
            SRNO(4),
            DOC_TYPE like ORDER_HEADER_IN-dOC_TYPE,
            SALES_ORG LIKE ORDER_HEADER_IN-SALES_ORG,
            DISTR_CHAN LIKE ORDER_HEADER_IN-DISTR_CHAN,
            DIVISION like ORDER_HEADER_IN-DIVISION,
           REQ_DATE_H(10),
            PURCH_DATE(10),
            PMNTTRMS LIKE ORDER_HEADER_IN-PMNTTRMS,
            PURCH_NO_C LIKE ORDER_HEADER_IN-PURCH_NO_C,
            ITM_NUMBER like BAPISDITM-ITM_NUMBER,
            CUST_MAT22 LIKE ORDER_ITEMS_IN-CUST_MAT22,
            PLANT LIKE ORDER_ITEMS_IN-PLANT,
            TARGET_QTY LIKE ORDER_ITEMS_IN-TARGET_QTY,
            PARTN_ROLE LIKE ORDER_PARTNERS-PARTN_ROLE,
            PARTN_NUMB LIKE ORDER_PARTNERS-PARTN_NUMB,
          END OF TAB.
    data: itab1 like alsmex_tabline occurs 0 with header
    line.
    DATA: gd_currentrow type i.
    data : PURCHASEORDER like ekko-ebeln.
    Data: tot_rec type i,     "Total Records
         gd_update type i,   "Main Table Increement Counter
         gd_lines type i,    "Success Table increement Counter
         w_textout like t100-text. "VARIABLE TO GET ERRORLOG
    data : begin of it_success occurs 0,
            SALESDOCUMENT LIKE BAPIVBELN-VBELN,  "PROJECT
          end of it_success.
    data : begin of it_error occurs 0,
            srno(4),
            err_msg(73) TYPE c,    "TO RETREIVE ERROR MESSAGES
         end of it_error.
    data : srno(4).
    DATA : SALESDOCUMENT LIKE  BAPIVBELN-VBELN.
    selection-screen begin of block b1 with frame.
    skip 3.
    parameter:p_infile like rlgrap-filename obligatory.
    skip 3.
    selection-screen end  of block b1.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_infile.
      PERFORM value_help.
    start-of-selection.
      call function 'ALSM_EXCEL_TO_INTERNAL_TABLE'
        EXPORTING
          filename                = p_infile
          i_begin_col             = '1'
          i_begin_row             = '2' "Do not require
    headings
          i_end_col               = '22'
          i_end_row               = '10000'
        TABLES
          intern                  = itab1
        EXCEPTIONS
          inconsistent_parameters = 1
          upload_ole              = 2
          others                  = 3.
      if sy-subrc <> 0.
        message e010(zz) with text-001. "Problem uploading
    Excel Spreadsheet
      endif.
    *perform open_group.
      sort itab1 by row col.
    Get first row retrieved
      read table itab1 index 1.
    Set first row retrieved to current row
      gd_currentrow = itab1-row.
      loop at itab1.
    Reset values for next row
        if itab1-row ne gd_currentrow.
          append tab .
          clear tab.
          gd_currentrow = itab1-row.
        endif.
        SHIFT ITAB1-VALUE LEFT DELETING LEADING SPACE.
        case itab1-col.
          when '0001'.
            TAB-SRNO = itab1-value.
          when '0002'.
            TAB-DOC_TYPE = itab1-value.
          when '0003'.
            TAB-SALES_ORG = itab1-value.
          when '0004'.
            TAB-DISTR_CHAN = itab1-value.
          when '0005'.
            TAB-DIVISION = itab1-value.
         when '0006'.
           TAB-REQ_DATE_H =  itab1-value.
          when '0006'.
            TAB-PURCH_DATE = itab1-value.
          when '0007'.
            TAB-PMNTTRMS = itab1-value.
          when '0008'.
            TAB-PURCH_NO_C = itab1-value.
            when '0009'.
            TAB-ITM_NUMBER = itab1-value.
           when '0010'.
            TAB-CUST_MAT22 = itab1-value.
          when '0011'.
            TAB-PLANT  = itab1-value.
          when '0012'.
            TAB-TARGET_QTY = itab1-value.
          when '0013'.
            TAB-PARTN_ROLE = itab1-value.
          when '0014'.
            TAB-PARTN_NUMB = itab1-value.
        endcase.
      endloop.
      append tab.
      clear tab.
      sort tab by SRNO.
      LOOP AT TAB.
       concatenate tab-REQ_DATE_H+4(4)
    tab-REQ_DATE_H2(2) tab-REQ_DATE_H0(2) into
    tab-REQ_DATE_H.
        concatenate tab-PURCH_DATE+4(4)
    tab-PURCH_DATE2(2) tab-PURCH_DATE0(2) into
    tab-PURCH_DATE.
        SRNO = TAB-SRNO.
        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
          EXPORTING
            INPUT  = tab-PARTN_NUMB
          IMPORTING
            OUTPUT = tab-PARTN_NUMB.
        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
          EXPORTING
            INPUT  = tab-CUST_MAT22
          IMPORTING
            OUTPUT = tab-CUST_MAT22.
        IF TAB-SRNO = SRNO.
          ORDER_HEADER_IN-DOC_TYPE = TAB-DOC_TYPE.
          ORDER_HEADER_IN-SALES_ORG = TAB-SALES_ORG.
          ORDER_HEADER_IN-DISTR_CHAN = TAB-DISTR_CHAN.
         ORDER_HEADER_IN-REQ_DATE_H = TAB-REQ_DATE_H.
          ORDER_HEADER_IN-PURCH_DATE = TAB-PURCH_DATE.
          ORDER_HEADER_IN-PMNTTRMS = TAB-PMNTTRMS.
          ORDER_HEADER_IN-PURCH_NO_C = TAB-PURCH_NO_C.
          ORDER_HEADER_IN-DIVISION  = tab-DIVISION.
          ORDER_ITEMS_IN-ITM_NUMBER = tab-ITM_NUMBER.
          ORDER_ITEMS_IN-material = TAB-CUST_MAT22.
          ORDER_ITEMS_IN-PLANT      = TAB-PLANT.
          APPEND ORDER_ITEMS_IN.
          ORDER_PARTNERS-PARTN_ROLE = TAB-PARTN_ROLE.
          ORDER_PARTNERS-PARTN_NUMB = TAB-PARTN_NUMB.
          APPEND ORDER_PARTNERS.
          ORDER_SCHEDULES_IN-ITM_NUMBER = tab-ITM_NUMBER.
          ORDER_SCHEDULES_IN-REQ_QTY = tab-TARGET_QTY.
          append ORDER_SCHEDULES_IN.
        ENDIF.
        AT END OF SRNO.
          CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
            EXPORTING
               SALESDOCUMENTIN               =
                 ORDER_HEADER_IN               = ORDER_HEADER_IN
               ORDER_HEADER_INX              =
               SENDER                        =
               BINARY_RELATIONSHIPTYPE       =
               INT_NUMBER_ASSIGNMENT         =
               BEHAVE_WHEN_ERROR             =
               LOGIC_SWITCH                  =
               TESTRUN                       =
               CONVERT                       = ' '
           IMPORTING
             SALESDOCUMENT                 = SALESDOCUMENT
            TABLES
             RETURN                        = RETURN
                 ORDER_ITEMS_IN                = ORDER_ITEMS_IN
               ORDER_ITEMS_INX               =
                 ORDER_PARTNERS                = ORDER_PARTNERS
                 ORDER_SCHEDULES_IN            = ORDER_SCHEDULES_IN
               ORDER_SCHEDULES_INX           =
               ORDER_CONDITIONS_IN           =
               ORDER_CONDITIONS_INX          =
               ORDER_CFGS_REF                =
               ORDER_CFGS_INST               =
               ORDER_CFGS_PART_OF            =
               ORDER_CFGS_VALUE              =
               ORDER_CFGS_BLOB               =
               ORDER_CFGS_VK                 =
               ORDER_CFGS_REFINST            =
               ORDER_CCARD                   =
               ORDER_TEXT                    =
             ORDER_KEYS                    = ORDER_KEYS
               EXTENSIONIN                   =
               PARTNERADDRESSES              =
          IF SALESDOCUMENT <> SPACE.
            commit work.
            ADD 1 TO gd_update.
            it_success-SALESDOCUMENT = SALESDOCUMENT.
            append it_success.
            CLEAR :SALESDOCUMENT,ORDER_HEADER_IN.
            REFRESH : RETURN,ORDER_ITEMS_IN,ORDER_PARTNERS.
          ELSE.
            loop at return.
              it_error-SRNO = tab-SRNO.
              it_error-err_msg = return-MESSAGE .
              Append it_error.
            ENDLOOP.
            CLEAR :SALESDOCUMENT,ORDER_HEADER_IN.
            REFRESH : RETURN,ORDER_ITEMS_IN,ORDER_PARTNERS.
          ENDIF.
        endat.
      endloop.
      DESCRIBE TABLE it_success LINES gd_lines.
      IF gd_lines GT 0.
        Display result report column headings
        PERFORM display_column_headings.
        Display result report
        PERFORM DISPLAY_SUCESS.
      ENDIF.
    IF SUCESS FAILS Display Error Report
      DESCRIBE TABLE it_error LINES gd_lines.
      IF gd_lines GT 0.
        PERFORM errorheadings.
        PERFORM errorreport.
      ENDIF.
    *&      Form  display_column_headings
          text
    FORM display_column_headings.
      WRITE:2 ' Success Report '(014) COLOR COL_POSITIVE.
      SKIP.
      WRITE:2 'The following records inserted
    successfully:'(013).
      WRITE:/ sy-uline(15).
      FORMAT COLOR COL_HEADING.
      WRITE:/      sy-vline,
               (10) 'Sales order'(004), sy-vline.
      WRITE:/ sy-uline(15).
    ENDFORM.                    "display_column_headings
    *Subroutine to display SUCESS REPORT
    FORM DISPLAY_SUCESS.
      FORMAT COLOR COL_NORMAL.
      LOOP AT it_success.
        WRITE:/      sy-vline,
            (10)  it_success-SALESDOCUMENT, sy-vline.
        CLEAR it_success.
      ENDLOOP.
      WRITE:/ sy-uline(15).
      REFRESH: it_success.
      FORMAT COLOR COL_BACKGROUND.
    ENDFORM.                               "
    DISPLAY_REPORT
    *&      Form  errorreport
          text
    FORM errorreport.
      LOOP AT it_error.
        WRITE:/      sy-vline,
                (10) it_error-SRNO, sy-vline,
                 (40) it_error-err_msg, sy-vline.
      ENDLOOP.
      WRITE:/ sy-uline(104).
      REFRESH: it_error.
    endform.                    "errorreport
    *&      Form  ERRORHEADINGS
          text
    FORM ERRORHEADINGS.
      SKIP.
      WRITE:2 ' Error Report '(007) COLOR COL_NEGATIVE.
      SKIP.
      WRITE:2 'The following records failed during
    update:'(008).
      WRITE:/ sy-uline(104).
      FORMAT COLOR COL_HEADING.
      WRITE:/      sy-vline,
              (10) 'ERROR.'(009), sy-vline.
      WRITE:/ sy-uline(104).
      FORMAT COLOR COL_NORMAL.
    ENDFORM.                    "ERRORHEADINGS
    **&      Form  value_help
          text
    -->  p1        text
    <--  p2        text
    FORM value_help .
      CALL FUNCTION 'DSVAS_DOC_WS_FILENAME_GET_50'
        EXPORTING
          DEF_FILENAME     = ' '
          DEF_PATH         = ' '
          MASK             = ',.,..'
          MODE             = 'O'
          TITLE            = ' '
        IMPORTING
          FILENAME         = p_infile
        EXCEPTIONS
          INV_WINSYS       = 1
          NO_BATCH         = 2
          SELECTION_CANCEL = 3
          SELECTION_ERROR  = 4
          OTHERS           = 5.
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    endform.                    "value_help
    Regards,
    Amit.

Maybe you are looking for

  • Where can I find my IMAP  Path Prefix for MAIL?

    I am unable to send mail from my IMAC OS X v 10.6.8. I use Airport Extreme and Use a WiFi Network.  This only happened recently but whenever I try to sent a message it says "Can't send message using the server smpt.aol.com" This is what I use and if

  • Does not load all of page

    some pages i go to do not load all pictures, links, and buttons. they were working but shortly after upgrade they quit working. i have tried on other browsers and they work fine there. i have checked all settings and have done a clear on history and

  • Can I call a built in LabVIEW function remotely?

    I would like to call a bunch of LabVIEW's built in GPIB functions on a remote computer to talk to a device attached to that computer. I was able to do this using VI server and by wrapping the GPIB function in a custom vi (this vi was just GPIB Write

  • Fixed Scrap

    Dear All, We are manufacturing bolts. In every production order we create there is a loss of exactly 5 bolts, where do I define this fixed scrap quantity (not percentage)

  • Adding Folder Subtyp

    Is there any way to add a folder subtype to the ones already available (ie, other than album, artist and genre..)? I have a large classical music collection, and it would be very convenient to be able to add a new characteristic (such as composer) to