Problem in Uploading sales order text data using LSMW

Hi All,
I am facing Problem in uploading open sales order data from legacy to SAP using LSMW.
We are trying to upload sales order data using LSMW Standard Batch/Direct input using program name RVINVB10 and program type D. We are not able to upload item text but have no problem in uploading remaining data.
the details we are passing to BTEXHKOM structure are......
BTEXHKOM-OLDNR = IHEADER-OLDORD_NO.
BTEXHKOM-LAISO = 'EN'.
BTEXHKOM-TDID = 'Z009'.
and the for structure BTEXLKOM
BTEXLKOM-OLDNR = IHEADER-OLDORD_NO.
BTEXLKOM-TXPARGRAPH = '/'.
CONCATENATE LITEM-DEPTID LITEM-DEPTNAME
INTO BTEXLKOM-TXLINE SEPARATED BY ' '.
we have three input source structures.
IHEADER Header structure
LITEM Line item structure ( Material data )
IPARTN Partners structure
The structure relationships are
BTEXHKOM <<< IHEADER.
BTEXLKOM <<< IHEADER.
Please let me know if I am doing some thing wrong or some thing else need to be done.
Thanks,
Chindam.

you can pass below values also
OLDNR         :  order number and item nuber
TXPARGRAPH  : VBBK
TXLINE        : your text.....

Similar Messages

  • Upload sales order item data

    Hi All,
    I need to upload sales order item data.Could you please tell me the steps in R/3 to replicate data BW.
    Thanks
    Raj

    Hi,
    Steps to upload sales order item:
    1) Maintain extract structure (LBWE)
    2) Maintain Datasource. (LBWE)
    3) Replicate datasource in BW
    4) Assign Infosources (RSA1 - BW)
    5) Maintain comm struc/transfer rules (RSA1 - BW)
    6) Maintain infocubes and update rules (RSA1 - BW)
    7) Activate extract structures (LBWE)
    8) Delete setup tables / setup extraction (For deleting – LBWG and for setup use OLI7BW).
    9) Infopackage for delta init
    10) Set up periodic V3 update (LBWE)
    11) InfoPackage for delta load.
    Hope this helps.
    PB

  • How can we remove an unwanted # in sales order texts created using a bapiFM

    Hi,
    i've written the following code which splits the record fetched from apllication server and moves it into a workarea.
    CONSTANTS:c_sep VALUE cl_abap_char_utilities=>horizontal_tab, "for separation
    SPLIT wa_tab1-rec1 AT c_sep INTO wa_inf_itm-inf_vbeln
                                           wa_inf_itm-itm_number
                                           wa_inf_itm-material
                                           wa_inf_itm-req_qty
                                           wa_inf_itm-uom
                                           wa_inf_itm-amount_pr00
                                           wa_inf_itm-amount_pi02
                                           wa_inf_itm-amount_mwst
                                           wa_inf_itm-amount_vprs
                                           wa_inf_itm-currency
                                           wa_inf_itm-text.
    Here c_sep will have a value '#' instead of 'space' in Flatfile from application server.
    The field 'wa_inf_itm-text' though it doesnot contain any value in debugging, when the sales order is created using FM 'BAPI_SALESORDER_CREATE_FROM_DAT2' the item texts are having a # character at the end of the text if it has any text(when checked in va03--sales order item text) or if it doesnot contain any text ,then also # character is seen in texts.
    Thanks & Regards,
    Prasad Reddy.

    hi
    use
    Replace all occurrence of '#' with space from .......
    I think it will solve ur problem.
    Rewards with point if helpful.
    Regards
    Santosh.

  • Creating Sales order texts while using BDC session method is not working

    Hi All,
    I have an existing program which creates sales order using BDC session method.( Actual program uses BAPI to create sales order and in case if any error occurs during creation of sales order BDC session is generated so that user can process it later and i am facing issues in this part of code where it uses BDC)
    I wanted to modify this BDC sesion  to update the sales order text also. I tried recording VA01 for creationg sales order text unfortunatly it is not capturing the data i am entering in the text fields.
    Please suggest if there is any way to create sales order using BDC.
    Regards
    Sheeba

    Hi Madhu,
    '=TP_CREATE' is the OK code i am getting for creating TEXTS. But the text entered are not captured in BDC.
    Part of BDC program generated for cretaing sales order texts.
    perform bdc_dynpro      using 'SAPMV45A' '4003'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=%_GC 128 22'.
    perform bdc_field       using 'LV70T-SPRAS'
                                  'EN'.
    perform bdc_dynpro      using 'SAPMV45A' '4003'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=TP_CREATE'.
    perform bdc_field       using 'LV70T-SPRAS'
                                  'EN'.
    perform bdc_dynpro      using 'SAPMV45A' '4003'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=%_GC 128 22'.
    perform bdc_field       using 'LV70T-SPRAS'
                                  'EN'.
    perform bdc_dynpro      using 'SAPMV45A' '4003'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=TP_CREATE'.
    perform bdc_field       using 'LV70T-SPRAS'
                                  'EN'.
    perform bdc_dynpro      using 'SAPMV45A' '4003'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/EBACK'.
    perform bdc_field       using 'LV70T-SPRAS'
                                  'EN'.
    perform bdc_dynpro      using 'SAPMV45A' '4001'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=SICH'.
    Regards,
    Sheeba

  • Upload Purchase order text tab using BDC

    Is it possible to upload Purchase order text tab in material master (tcode mm01) using a BDC.
    If so pls tell me how to upload the same, what is the field name of the box.
    Regards,
    Senthil

    u need to use READ_TEXT or SAVE_TEXT or WRITE_TEXT or COMMIT_TEXT to upload text into SAP.

  • TEXTS in Sales Order - Text types used or not ?

    Hi experts,
    We have 8 text types in sales orders line items. Some of them are used to enter text and some are not. Is there a table from where we can find out if for all orders any particular text type is used or not ?
    In STXH and STXL, how can we find out if a particular order # has an entry of texts in it or not.
    How can we get a text i.d. from the sales order. OR find a link between sales Order and tables STXH/STXL........ how can we search these tables ?
    I really need some help on this mysterious Text storage strategy of SAP.
    Thanks a LOT
    Ron

    Yes I am aware of the fact that text is accessed thru read_text FM .....
    My question is what parameters/ field values can we plug in STXH/STXL to get info that a particular "text" entry exists in this table. I have a sales order which has few texts, I want to know if they have an entry in STXH and STXL about their text i.d.s....
    Let me put it this way - What ever entry exists in STXH for this sales Order I want to see that. What parameters of this sales order do I pass in this Table STXH to see that entry ??
    I hope this is clear now

  • Upload Of Vendor Create Data using LSMW

    Hi,
    I am trying to upload the vendor data for more than 1000 records from flat file structure to sap using LSMW (standard batch/ direct input) for XK01 transaction code. For uploading the house and street address i have created additional fields STR_SUPPL1 and STR_SUPPL2 in addition to STRAS. But in "Maintain Field Mapping and Conversion Rules" I am not able to locate the fields for mapping STR_SUPPL1 and STR_SUPPL2. Can any one please suggest me how to go about it. Thanks in advance.
    Regards,
    Sangram

    Hi
      As per your requirements when you r uploading the data in the  "Maintain Field Mapping and Conversion Rules" it will display your field and some additional fields,and there you have to select for which field you r going to upload the data.
    You have mentioned that you have created some two extra field as STR_SUPPL1 and STR_SUPPL2.Can you plz clarify me where you have declared those fields and how.
    If you have done it in   "Maintain Object Attributes" than it should display in the Field Mapping or you check it with " Maintain Source Fields" part,wheather you have enter all the fields appropriately or not.
    I hope this will help you to solve your problem.
    Thanks
    Mrutyunjaya Tripathy

  • Sales order creation  by using LSMW

    Hi All,
    We have designed one LSMW program by which we are able to create Sales Orders.
    Import method for this LSMW is *BAPI Method*.So finally by processing IDOC steps, sales orders getting created.
    My req is
      1) We have to schedule a background job for this LSMW
      2) Finally I need to provide all the Sales Orders those are created into one Text Document.
    Can you please tell me do we have any solution for the requirements I have mentioned.
    Thank You very much inadvance............................

    answere..

  • Re:Uploading of material master data using lsmw-idoc method

    Hi friends,
                While processing each idoc  one log on window is opening,and status of idoc is 51,eventhough i am passing material description to maktx of e1maktm,it is showing an 'No description is passed'.
    Colud you please tell me how to correct these errors,i am new to this lsmw-idoc method.
    Thanks in advance,
    Anusha.

    Thank you for reply.
    Actually I am uploading the data in flat file from file port to sap.
    In idoc inbound processing of lsmw i have created a file port and iam giving the logical system name of the same client.
    is this the correct procedure.
    Every time when i process each idoc one new logon window is opening and it is showing idoc status as 51.
    could you please tell me how to correct this one.

  • Sales Order Header Data. Texts

    Hy All Experts.
    I wnt to put Filed Sales Order Header data. i go to transaction va02. ->> disp Doc. header Deatils.
    select Tab Texts. --> Notes .
    I wnt to put a notes in a sales order report. so hw to identify. that field.
    Please guide me above matter.
    Thnks
    Bhavesh Panchal.

    Hi Bhavesh Panchal,
                  Use read text function module and get data from header text for ur sales report.
    get object, id, en from text area. Double click the text area and click Goto menu and choose header.
    for ex
         TDNAME = IT_ORDER-VBELN.
          OBJECT = 'VBBK'.
          ID = '0001'.
          EN = 'EN'.
          CALL FUNCTION 'READ_TEXT'
            EXPORTING
              CLIENT                  = SY-MANDT
              ID                      = ID
              LANGUAGE                = EN
              NAME                    = TDNAME
              OBJECT                  = OBJECT
            TABLES
              LINES                   = LINES
            EXCEPTIONS
              ID                      = 1
              LANGUAGE                = 2
              NAME                    = 3
              NOT_FOUND               = 4
              OBJECT                  = 5
              REFERENCE_CHECK         = 6
              WRONG_ACCESS_TO_ARCHIVE = 7
              OTHERS                  = 8.
          DELETE LINES WHERE TDLINE IS INITIAL.
    LOOP AT LINES.
      IT_ORDER-MSG1 = LINES-TDLINE.
      EXIT.
      ENDLOOP.

  • Upload Purchase order text  using BDC  while updating Material Master MM02

    Hi All,
    Please help me out with sample code upload PO Txt ( long text...which is more than 72 chars)using MM02. Its very urgent
    I am not able to pass data into following fields seen in recording,
    RSTXT-TXLINE(02),
    RSTXT-TXLINE(03),
    RSTXT-TXLINE(04),
    RSTXT-TXLINE(05),  as we can see only RSTXT-TXLINE field in the RSTXT structure......
    how to split  the long text into 72 chrs each and pass into data into the RSTXT-TXLINE(02), RSTXT-TXLINE(03), RSTXT-TXLINE(04)....correspondingly........
    Thanks in advance.....
    Reagards,
    Prasad KR.

    Hi
    see the sample program
    REPORT zmm_longtext
           NO STANDARD PAGE HEADING
           LINE-SIZE 255.
    Internal Table for Upload of Long Texts Data
    DATA: BEGIN OF itab1 OCCURS 0,
            matnr    LIKE mara-matnr,    " Material
            text1    LIKE tline-tdline,  " Long Text
            text2    LIKE tline-tdline,  " Long Text
            text3    LIKE tline-tdline,  " Long Text
            text4    LIKE tline-tdline,  " Long Text
            text5    LIKE tline-tdline,  " Long Text
            text6    LIKE tline-tdline,  " Long Text
            text7    LIKE tline-tdline,  " Long Text
            text8    LIKE tline-tdline,  " Long Text
            text9    LIKE tline-tdline,  " Long Text
            text10   LIKE tline-tdline,  " Long Text
            text11   LIKE tline-tdline,  " Long Text
            text12   LIKE tline-tdline,  " Long Text
            text13   LIKE tline-tdline,  " Long Text
            text14   LIKE tline-tdline,  " Long Text
            text15   LIKE tline-tdline,  " Long Text
            text16   LIKE tline-tdline,  " Long Text
            text17   LIKE tline-tdline,  " Long Text
            text18   LIKE tline-tdline,  " Long Text
            text19   LIKE tline-tdline,  " Long Text
            text20   LIKE tline-tdline,  " Long Text
            text21   LIKE tline-tdline,  " Long Text
            text22   LIKE tline-tdline,  " Long Text
            text23   LIKE tline-tdline,  " Long Text
            text24   LIKE tline-tdline,  " Long Text
            text25   LIKE tline-tdline,  " Long Text
          END OF itab1.
    Internal Table for Upload of Long Texts Data
    DATA: BEGIN OF itab OCCURS 0,
            matnr LIKE mara-matnr,    " Material
            text  LIKE tline-tdline,  " Long Text
          END OF itab.
    To create Long Text lines for CREATE_TEXT function module
    DATA:BEGIN OF dt_lines OCCURS 0.
            INCLUDE STRUCTURE tline.   " Long Text
    DATA:END OF dt_lines.
    Variable declarations for CREATE_TEXT function module
    DATA : dl_name TYPE thead-tdname,   " Object Name
           dl_lan TYPE thead-tdspras,   " Language
           gv_matnr TYPE matnr.
    Constants
    CONSTANTS:
    Object ID for Long Text of Material Basic Data 1
      c_best     TYPE thead-tdid VALUE 'GRUN',
      c_material TYPE thead-tdobject VALUE 'MATERIAL'. " Object
    Parameters
    PARAMETERS p_file LIKE rlgrap-filename.
    At selection-screen on Value Request for file Name
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
    Get the F4 Values for the File
      CALL FUNCTION 'F4_FILENAME'
        EXPORTING
          program_name  = syst-cprog
          dynpro_number = syst-dynnr
        IMPORTING
          file_name     = p_file.
    Start Of Selection
    START-OF-SELECTION.
    *To Upload Flat file
      CALL FUNCTION 'UPLOAD'
        EXPORTING
          filename                = p_file
          filetype                = 'DAT'
        TABLES
          data_tab                = itab1
        EXCEPTIONS
          conversion_error        = 1
          invalid_table_width     = 2
          invalid_type            = 3
          no_batch                = 4
          unknown_error           = 5
          gui_refuse_filetransfer = 6
          OTHERS                  = 7.
      SORT itab1 BY matnr.
      LOOP AT itab1.
        CLEAR gv_matnr.
        SELECT SINGLE matnr INTO gv_matnr
           FROM mara WHERE bismt = itab1-matnr.
        IF itab1-text25 NE ' '.
          itab-matnr = gv_matnr.
          itab-text  = itab1-text25.
          APPEND itab.
        ENDIF.
        IF itab1-text24 NE ' '.
          itab-matnr = gv_matnr.
          itab-text  = itab1-text24.
          APPEND itab.
        ENDIF.
        IF itab1-text23 NE ' '.
          itab-matnr = gv_matnr.
          itab-text  = itab1-text23.
          APPEND itab.
        ENDIF.
        IF itab1-text22 NE ' '.
          itab-matnr = gv_matnr.
          itab-text  = itab1-text22.
          APPEND itab.
        ENDIF.
        IF itab1-text21 NE ' '.
          itab-matnr = gv_matnr.
          itab-text  = itab1-text21.
          APPEND itab.
        ENDIF.
        IF itab1-text20 NE ' '.
          itab-matnr = gv_matnr.
          itab-text  = itab1-text20.
          APPEND itab.
        ENDIF.
        IF itab1-text19 NE ' '.
          itab-matnr = gv_matnr.
          itab-text  = itab1-text19.
          APPEND itab.
        ENDIF.
        IF itab1-text18 NE ' '.
          itab-matnr = gv_matnr.
          itab-text  = itab1-text18.
          APPEND itab.
        ENDIF.
        IF itab1-text17 NE ' '.
          itab-matnr = gv_matnr.
          itab-text  = itab1-text17.
          APPEND itab.
        ENDIF.
        IF itab1-text16 NE ' '.
          itab-matnr = gv_matnr.
          itab-text  = itab1-text16.
          APPEND itab.
        ENDIF.
        IF itab1-text15 NE ' '.
          itab-matnr = gv_matnr.
          itab-text  = itab1-text15.
          APPEND itab.
        ENDIF.
        IF itab1-text14 NE ' '.
          itab-matnr = gv_matnr.
          itab-text  = itab1-text14.
          APPEND itab.
        ENDIF.
        IF itab1-text13 NE ' '.
          itab-matnr = gv_matnr.
          itab-text  = itab1-text13.
          APPEND itab.
        ENDIF.
        IF itab1-text12 NE ' '.
          itab-matnr = gv_matnr.
          itab-text  = itab1-text12.
          APPEND itab.
        ENDIF.
        IF itab1-text11 NE ' '.
          itab-matnr = gv_matnr.
          itab-text  = itab1-text11.
          APPEND itab.
        ENDIF.
        IF itab1-text10 NE ' '.
          itab-matnr = gv_matnr.
          itab-text  = itab1-text10.
          APPEND itab.
        ENDIF.
        IF itab1-text9 NE ' '.
          itab-matnr = gv_matnr.
          itab-text  = itab1-text9.
          APPEND itab.
        ENDIF.
        IF itab1-text8 NE ' '.
          itab-matnr = gv_matnr.
          itab-text  = itab1-text8.
          APPEND itab.
        ENDIF.
        IF itab1-text7 NE ' '.
          itab-matnr = gv_matnr.
          itab-text  = itab1-text7.
          APPEND itab.
        ENDIF.
        IF itab1-text6 NE ' '.
          itab-matnr = gv_matnr.
          itab-text  = itab1-text6.
          APPEND itab.
        ENDIF.
        IF itab1-text5 NE ' '.
          itab-matnr = gv_matnr.
          itab-text  = itab1-text5.
          APPEND itab.
        ENDIF.
        IF itab1-text4 NE ' '.
          itab-matnr = gv_matnr.
          itab-text  = itab1-text4.
          APPEND itab.
        ENDIF.
        IF itab1-text3 NE ' '.
          itab-matnr = gv_matnr.
          itab-text  = itab1-text3.
          APPEND itab.
        ENDIF.
           IF itab1-text2 NE ' '.
        itab-matnr = gv_matnr.
        itab-text  = itab1-text2.
        APPEND itab.
           ENDIF.
        IF itab1-text1 NE ' '.
          itab-matnr = gv_matnr.
          itab-text  = itab1-text1.
          APPEND itab.
        ENDIF.
        CLEAR itab.
      ENDLOOP.
      DELETE itab WHERE matnr EQ ' '.
    Upload the Texts
      SORT itab BY matnr.
      LOOP AT itab.
        dt_lines-tdformat = 'ST'.
        dt_lines-tdline = itab-text.
        APPEND dt_lines.
        dl_lan = sy-langu.
        dl_name = itab-matnr.
    Call the Function Module to Create Text
        CALL FUNCTION 'CREATE_TEXT'
          EXPORTING
            fid         = c_best
            flanguage   = dl_lan
            fname       = dl_name
            fobject     = c_material
            save_direct = 'X'
            fformat     = '*'
          TABLES
            flines      = dt_lines
          EXCEPTIONS
            no_init     = 1
            no_save     = 2
            OTHERS      = 3.
        IF sy-subrc <> 0.
          WRITE:/ 'Long Text Creation failed for Material'(001),
                 itab-matnr.
        ELSE.
          WRITE:/ 'Long Text Created Successfully for Material'(002),
                 itab-matnr.
        ENDIF.
        AT END OF matnr.
          REFRESH dt_lines.
        ENDAT.
      ENDLOOP.
    Reward points for useful Answers
    Regards
    Anji

  • Sales order header data change by using the ORDERS05 IDOC

    Hello Team
    I am getting sales order number and some code value from the legacy system. i need to check whether the sales order is avialable in SAP or not. if it is there, i need to update the CODE value (ie for example ABC100) in sales order header data> order data> your reference field.  For doing this i am using the IDOC type ORDERS05 and message type ORDCHG message type.
    Now i want to know what are the mandatory fields which i need to do the mapping for the IDOC ORDERS05, to change the sales order header data. please check and suggest me the required fields of the IDOC to be mapped, so that i can change the sales order header data.
    Please correct me if i am doing something wrong here.
    Regards
    Rj

    Hello chirag
    Thanks for your reply. My requirement is to change the sales order which is already avialable in SAP. Just i need to change the header data of the sales order, for example if i am getting the sales order as 1000 and CODE as ABC100. i need to change the Sales document number 1000 and put the code ABC100 in sales order header data>orders data>your reference field.
    So now i want to know the below points
    1. what are the mandatory fields for which i need to pass the values for the IDOC ORDERS05.
    2. what is the user-exit used for picking up those values from SAP because i am getting only sales order number and CODE values from legacy system.
    Please check and suggest me accordingly.
    Regards
    Rj

  • Uploading sales orders in background

    Hi everyone,
    Iam trying to upload sales orders in background.As my program is a customised program of the standard sales order uplaod program RVINVB10 ,it is a direct input program which updates the tables using the function modules.
    So to run direct input programs in background we are using transaction BMV0,creating a job and running it with the desired variant.the file which has the salesorders to be uploaded is also in the application server.
    the problem is we have to upload bulk data so when ever an error occurs in the transaction BMV0,it says "Job cancelled after system exception ERROR_MESSAGE" . but my requirement is it should log the error and continue creating the other orders and log all the errors possible instead of cancelling the job.
    please help.
    Regards,
    Sravanthi

    Hi,
    One your bapi has returned the error table  'GT_RETURN'... you can use the following logic...
    LOOP AT gt_return INTO gs_return WHERE type CA 'AE'.
        CLEAR gs_bapi_errors.
        CALL FUNCTION 'MESSAGE_TEXT_BUILD'
             EXPORTING
                  msgid               = gs_return-id
                  msgnr               = gs_return-number
                  msgv1               = gs_return-message_v1
                  msgv2               = gs_return-message_v2
                  msgv3               = gs_return-message_v3
                  msgv4               = gs_return-message_v4
             IMPORTING
                  message_text_output = gs_bapi_errors.
        APPEND gs_bapi_errors TO gt_bapi_errors.
      ENDLOOP.
    * Update successful
      IF gt_bapi_errors[] IS INITIAL.
        REFRESH gt_return.
        CLEAR ls_return.
        CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
             EXPORTING
                  wait   = c_x
             IMPORTING
                  return = ls_return.
        IF NOT ls_return IS INITIAL.
          CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
          APPEND ls_return TO gt_return.
          PERFORM store_bapi_errors.
        ENDIF.
    * Update failed
      ELSE.
        CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
      ENDIF.
    This will not interrupt your processing...

  • Get the sales order text from ITS and save it in SAP.

    Hi,
    I have created an application to create sales order from ITS. In this app i'm having a text field to fet the header text for the order. & after that I'm calling an RFC which has a BAPI to create the sales order.
    Now, when i enter the text for header texts in frontend (separated by ENTER), then it saves only the first line of the text.
    I've tried using :
    SPLIT ordernotes AT cl_abap_char_utilities=>cr_lf INTO TABLE t_ordnotes.
    and using FM: CREATE_TEXT,
    but still, it is saving only the first line.
    Can anyone please help me with this ?????
    Its urgent.
    Thanks in advance,
    Hemant.

    Hi
    See the sample BDC program that is used to upload the Material LONG Texts into SAP using MM01 Tcode
    check this may be helpful
    REPORT zmm_longtext
           NO STANDARD PAGE HEADING
           LINE-SIZE 255.
    Internal Table for Upload of Long Texts Data
    DATA: BEGIN OF itab1 OCCURS 0,
            matnr    LIKE mara-matnr,    " Material
            text     LIKE tline-tdline,  " Long Text
          END OF itab1.
    Internal Table for Upload of Long Texts Data
    DATA: BEGIN OF itab OCCURS 0,
            matnr LIKE mara-matnr,    " Material
            text  LIKE tline-tdline,  " Long Text
          END OF itab.
    To create Long Text lines for CREATE_TEXT function module
    DATA:BEGIN OF dt_lines OCCURS 0.
            INCLUDE STRUCTURE tline.   " Long Text
    DATA:END OF dt_lines.
    Variable declarations for CREATE_TEXT function module
    DATA : dl_name TYPE thead-tdname,   " Object Name
           dl_lan TYPE thead-tdspras,   " Language
           gv_matnr TYPE matnr.
    Constants
    CONSTANTS:
    Object ID for Long Text of Material Basic Data 1
      c_best     TYPE thead-tdid VALUE 'GRUN',
      c_material TYPE thead-tdobject VALUE 'MATERIAL'. " Object
    Parameters
    PARAMETERS p_file LIKE rlgrap-filename.
    At selection-screen on Value Request for file Name
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
    Get the F4 Values for the File
      CALL FUNCTION 'F4_FILENAME'
        EXPORTING
          program_name  = syst-cprog
          dynpro_number = syst-dynnr
        IMPORTING
          file_name     = p_file.
    Start Of Selection
    START-OF-SELECTION.
    *To Upload Flat file
      CALL FUNCTION 'UPLOAD'
        EXPORTING
          filename                = p_file
          filetype                = 'DAT'
        TABLES
          data_tab                = itab1
        EXCEPTIONS
          conversion_error        = 1
          invalid_table_width     = 2
          invalid_type            = 3
          no_batch                = 4
          unknown_error           = 5
          gui_refuse_filetransfer = 6
          OTHERS                  = 7.
      SORT itab1 BY matnr.
      LOOP AT itab1.
        CLEAR gv_matnr.
        SELECT SINGLE matnr INTO gv_matnr
           FROM mara WHERE bismt = itab1-matnr.
        IF itab1-text NE ' '.
          itab-matnr = gv_matnr.
          itab-text  = itab1-text.
          APPEND itab.
        ENDIF.
        CLEAR itab.
      ENDLOOP.
      DELETE itab WHERE matnr EQ ' '.
    Upload the Texts
      SORT itab BY matnr.
      LOOP AT itab.
        dt_lines-tdformat = 'ST'.
        dt_lines-tdline = itab-text.
        APPEND dt_lines.
        dl_lan = sy-langu.
        dl_name = itab-matnr.
    Call the Function Module to Create Text
        CALL FUNCTION 'CREATE_TEXT'
          EXPORTING
            fid         = c_best
            flanguage   = dl_lan
            fname       = dl_name
            fobject     = c_material
            save_direct = 'X'
            fformat     = '*'
          TABLES
            flines      = dt_lines
          EXCEPTIONS
            no_init     = 1
            no_save     = 2
            OTHERS      = 3.
        IF sy-subrc <> 0.
          WRITE:/ 'Long Text Creation failed for Material'(001),
                 itab-matnr.
        ELSE.
          WRITE:/ 'Long Text Created Successfully for Material'(002),
                 itab-matnr.
        ENDIF.
        AT END OF matnr.
          REFRESH dt_lines.
        ENDAT.
      ENDLOOP.
    <b>Reward points for useful Answers</b>
    Regards
    Anji

  • Sales orders flow - dates difference

    Dear All,
    I need to build a model for a report which needs to have the days difference between the sales order creation date, delivery date, goods issue date  and billing date. The lowest level of detail should be the Sales Order/Item and one Sales Order/Item can origin different Delivery Items.
    Base on this, i'm wondering how can i model this scenario...
    Do you have any suggestion?
    Thanks in advance and best regards,
    Nuno

    Hi,
    I need to build a model for a report which needs to have the days difference between the
    Sales order creation date,
    Delivery date,
    Goods issue date ,
    Billing date.
    In your question you didn't mension what differences you need
    Eg:
    Sales order creation date - Delivery date
    Goods issue date - Billing date
    Sales order creation date - Billing date
    Delivery date - Goods issue date
    Like what combination you need?.
    Steps:
    Bring all InfoObejcts into Cube and once youn have all required InfoObecjts in your cube then in reporting level you can play like any thing. So first bring all Dates data into Cube. Use 0SD_C03 InfoCube with relavent datasources.
    Then Use Formula Variables with Replacement pathes and then do simple Substractions at reporting level. Your problem is resolved.
    See the below Article how I'm calculating Age of teh Material. Here I'm using Custome Exit Variable to get teh System Data, but in your case you don't need it, you just use Formula Variable with Replcemet Path and replace with Date and then do Substartion.
    Calculating the Ageing of the Materials
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/business-intelligence/a-c/calculating%20the%20ageing%20of%20the%20materials.pdf
    https://wiki.sdn.sap.com/wiki/display/profile/Surendra+Reddy
    Thanks
    Reddy

Maybe you are looking for