Extracting Text Field using a function module

Hi Experts,
      We are trying to extract a test field from the R3 using a Function Module.
              The Text from R3 Looks like this
             Input Parameters
              ID -1
              SEQ 2
It displays
          Column 1 Column2
           This is test
           strategy for Function
           Module xxxx
So we put in some parameters to get this test field displayed. As you see the above is just one field but they are in different lines
        So what happens when we put in the database is it adds a new field
Eg
ID SEQ Column 1 Column2
1   2        *            This is test
1   2        *            strategy for Function
1   2        *            Module xxxx
The result that we need is
D SEQ Column 1 Column2
1   2        *            This is test strategy for Function Module xxxx
How can we handle this in the Query Transform
Your help in advance is appreciated.
Thanks
Edited by: alangilbi on Nov 17, 2010 3:49 AM

Have you considered using a pivot transform to get your rows into columns and then a query transform to concatenate the columns together?

Similar Messages

  • Ad-Hoc Query Field using HR_99S_INTERVAL_BETWEEN_DATES function module

    I have created an additional field in Sq02 to calculate years between two dates and am using function module HR_99S_INTERVAL_BETWEEN_DATES.
    There are no syntax erros but when I run a query in Sq01 and output the field it doesn't calculate instead gives "00000" output.
    The field Code in the additional field
    Clear ZHR_SERVICEYRS.
    DATA: V_MONTHS TYPE  i.
    DATA: V_YEARS TYPE  i.
    DATA: V_MONTHS1 TYPE  char20.
    DATA: V_YEARS1 TYPE  char20.
    CALL FUNCTION 'HR_99S_INTERVAL_BETWEEN_DATES'
      EXPORTING
       BEGDA           = P0002-GBDAT
       ENDDA           = Sy-Datum
      TAB_MODE        = ' '
    IMPORTING
      DAYS            =
      C_WEEKS         =
       C_MONTHS        = V_MONTHS
       C_YEARS         = V_YEARS
      WEEKS           =
      MONTHS          =
      YEARS           =
      D_MONTHS        =
      MONTH_TAB       =
    V_MONTHS1 = V_MONTHS.
    V_YEARS1 =  V_YEARS.
    CONCATENATE V_YEARS1  '.'  V_MONTHS1 INTO ZHR_SERVICEYRS.
    condense ZHR_SERVICEYRS.
    has anybody had similar problems! Help Appreciated!

    Hi Anuj,
    Yes, you use Transaction Code SQ02.  Find your infoset on the list - if you want to create a new infoset you can do so.  If it is an existing infoset, select it and Change.  On the next screen you will see all the infotypes in that infoset on the left.  The fields available for Ad Hoc are on the right.  Open the infotype table on the left and the field group on the right.  If the field is not included in the field group all you have to do is drag and drop from the list on the left to the correct field group.  If the infotype is not already in your infoset, select Edit --> Change Infotype Selection from the top menu bar.  Place a check in the new infotype and then return and do the drag and drop if necessary.  You will find the basic fields already moved to the field group. 
    You say you want information from IT0008-Basic Pay and IT1005-Planned Compensation.  Problem is that if you use the standard HR logical data base, there is no link directly between a person and IT1005.  IT1005 is assigned to a Position or a Job.  If it is assigned to a Position, you can select the "Change Infotype Selection" action and ago to the bottom of the list to Related Objects.  Here select Position and open that to find the IT1005.  If the IT1005 is tied to the Job, there is no direct link. Thus, if it does not already exist, you will need to create an infoset based on the PCH logical database and object Position.  Now you can link that Position to "Holder"-Person and "Described by"-Job.  Again, select the infotypes and fields you want and you will be able to obtain your information via Ad Hoc Query based on that infoset.
    Paul

  • Fields inclusion for Function Module Extractor

    Hi Gurus,
    I am planning to design a Function Module based extractor. This Function modules is supposed to extract data from approx 10 different tables. Most of the tables have 5 or more fields of it to be pulled in.
    However, there are also few tables, which have got just a single field or just 2 fields.
    As a design, is it a good idea to include the logic of extracting these fields in the Function module? or
    Is it recommended to have these fields included via a user exit, once the datasource is developed?
    I appreciate all the help

    Thanks Dash I have assigned the points.
    I guess you are recommending the User Exit approach as mentioned in my original post where few of my tables have got just a single field or just 2 fields.
    Let me know please.
    Other SDNers,
    Let me have your thoughts too

  • How to keep long text in bdc using create_text  function module

    hi,
    ihave bdc in that i having field like long text i have to upload the long text using create_text function module how to use and where to use in bdc. wat parameters i have to pass exactly.
    i need some other information like how can i pass this to BDC i got like this .
    can u plz check it.
    its a length of 255 chaters
    perform bdc_field using 'RSTXT-TXLINE(02)'
    'zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz'
    & 'zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz'.
    perform bdc_field using 'RSTXT-TXLINE(03)'
    'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
    & 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'.
    perform bdc_field using 'RSTXT-TXLINE(04)'
    'yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy'
    & 'yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy'.
    perform bdc_field using 'RSTXT-TXLINE(05)'
    'hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh'
    & 'hhhhhhhhhhhhhhhhhhhhhh'.

    Hi,
    Use this coding where do u want,
    data: begin of textline occurs 10.
            include structure tline.
    data: end of textline.
    start-of-selection.
    textline-tdformat = '*'.
    textline-tdline = 'TESTING FOR CREATION OF TEXT'.
    append textline.
    clear textline.
        call function 'CREATE_TEXT'
             exporting
                  fid       = '0013'
                  flanguage = sy-langu
                  fname     = '0095000501'
                  fobject   = 'VBBK'
             tables
                  flines    = textline
             exceptions
                  no_init   = 01
                  no_save   = 02.
    end-of-selection.

  • Use of text elements in wirte_form function module.

    Hi guru's,
    Could any one tell me  what is the use of text elements in write_form functional module SAP SCRIPTS. As per my knowledge text elements are used for multi language purpose is there any other advantage other than that.
    Thanks in advance.
    Vardhan.

    Hello.
    A text element is a block in script that can be written several times in your document. You can put fixed texts, variables, include texts, images, etc etc
    When you see WRITE_FORM, element 'X', you know that everything that is inside element /E X of your script is writen. It's very usefful to organize your script, and it eases to construct a very complex script.
    It's also usefull to translations in SE63.
    Best regards.
    Valter Oliveira.
    Edited by: Valter Oliveira on May 27, 2008 10:05 AM

  • Null character removal in sap using a function module

    Little background :
    1) we are using a lot of interfaces with legacy and the data in sap has null characters for example : phone#123 .
    the prob is not on sap side but on bw side when i extract this data it converts to hex format and the load fails.
    2) so i wrote a abap function module for the extractor which uses the function modules SRET_TEXT_TO_BINARY and SRET_BINARY_TO_TEXT and passed the variable that has the null character and replaced it with space.
    3) the prob is i get null characters in a lot of fields now and i am not sure how i can pass it to SRET_BINARY_TO_TEXT OR SRET_TEXT_TO_BINARY as they are SAP standard and it takes in just a single variable. i have all my fields in a internal table .
    I apologize for the the length of the message but any help is greatly appreciated.I want to know how to pass a internal table with null in all fields to a standard function module bec . The code is below :
    =======================================================
      CALL FUNCTION 'SRET_TEXT_TO_BINARY'
        EXPORTING
          TEXT                        = input
        TEXT_LENGTH                 = -1
          LAISO                       = '00'
        IV_CATID                    = ' '
        IV_RFC_FOR_INITIALIZE       = ' '
       IMPORTING
        OUTPUT_LENGTH               =
          XBUFFER                     = v_hexa
       EXCEPTIONS
          FAILED                      = 1
          OTHERS                      = 2
      IF SY-SUBRC = 0.
    *Replacing all NULL (X'00') values with SPACE (X'20')
      REPLACE ALL OCCURRENCES OF c_null IN v_hexa WITH c_space IN BYTE MODE.
        CALL FUNCTION 'SRET_BINARY_TO_TEXT'
          EXPORTING
            XBUFFER                     = v_hexa
            LAISO                       = '00'
          IV_CATID                    = ' '
          IV_RFC_FOR_INITIALIZE       = ' '
         IMPORTING
          OUTPUT_LENGTH               =
            TEXTBUFFER                  = output
         EXCEPTIONS
            FAILED                      = 1
            OTHERS                      = 2

    The entire code :
    =======================================================
    FUNCTION YFR1_CA_U_NULL_SPACE.
    ""Local interface:
    *"  IMPORTING
    *"     REFERENCE(INPUT) TYPE  C
    *"  EXPORTING
    *"     REFERENCE(OUTPUT) TYPE  C
    *"  EXCEPTIONS
    *"      LENGTH_TOO_LONG
    *"      FAILED
    This function provides the functionality of replacing the NULL
    characters with SPACE .
      DATA : v_hexa(100) TYPE X ,
             c_space(2) TYPE X VALUE '0020' ,
             c_null(2) TYPE X VALUE '0000' ,
             v_length TYPE i .
      COMPUTE v_length = STRLEN( input ) .
      IF v_length > '100'.
        RAISE length_too_long .
      ENDIF .
      CALL FUNCTION 'SRET_TEXT_TO_BINARY'
        EXPORTING
          TEXT                        = input
        TEXT_LENGTH                 = -1
          LAISO                       = '00'
        IV_CATID                    = ' '
        IV_RFC_FOR_INITIALIZE       = ' '
       IMPORTING
        OUTPUT_LENGTH               =
          XBUFFER                     = v_hexa
       EXCEPTIONS
          FAILED                      = 1
          OTHERS                      = 2
      IF SY-SUBRC = 0.
    *Replacing all NULL (X'00') values with SPACE (X'20')
      REPLACE ALL OCCURRENCES OF c_null IN v_hexa WITH c_space IN BYTE MODE.
        CALL FUNCTION 'SRET_BINARY_TO_TEXT'
          EXPORTING
            XBUFFER                     = v_hexa
            LAISO                       = '00'
          IV_CATID                    = ' '
          IV_RFC_FOR_INITIALIZE       = ' '
         IMPORTING
          OUTPUT_LENGTH               =
            TEXTBUFFER                  = output
         EXCEPTIONS
            FAILED                      = 1
            OTHERS                      = 2
        IF SY-SUBRC <> 0.
          RAISE FAILED .
        ENDIF.
      ELSE.
        RAISE FAILED .
      ENDIF .
    ENDFUNCTION.

  • How to use a function module in a subroutine

    Hi,
      I am working on a report where i have to create list boxes for 5 fields.Instead of using the function module VRM_SET_VALUES for each field can i use subroutine?
    If so, can anyone tell me the procedure for that?Its very urgent.
    Thanks and Regards,
    Hema

    Hi,
       I have written the code like this.
    FORM VALUE USING V_NAME.
      CALL FUNCTION 'VRM_SET_VALUES'
        EXPORTING id     = v_name
                  values = v_list.
      ENDFORM.
    AT SELECTION-SCREEN OUTPUT.
      REFRESH V_LIST.
      v_name = 'P_COMMER'.
      v_value-key = 'C'.
      v_value-text = 'Commercial'.
      APPEND v_value TO v_list.
      v_value-key = 'N'.
      v_value-text = 'Non-Commercial'.
      APPEND v_value TO v_list.
      v_value-key = ' ' .
      v_value-text = 'Both'.
      APPEND v_value to v_list.
      PERFORM VALUE USING V_NAME.
      REFRESH V_LIST1.
      v_name1 = 'P_DIRECT'.
      v_value1-key = 'D'.
      v_value1-text = 'Direct'.
      APPEND v_value1 to v_list1.
      v_value1-key = 'I'.
      v_value1-text = 'Indirect'.
      APPEND v_value1 to v_list1.
      PERFORM VALUE USING V_NAME1.
      REFRESH V_LIST2.
      v_name2 = 'P_DIR'.
      v_value2-key = 'D'.
      v_value2-text = 'D'.
      APPEND v_value2 TO v_list2.
      v_value2-key = 'C'.
      v_value2-text = 'C'.
      APPEND v_value2 TO v_list2.
      v_value2-key = ' ' .
      v_value2-text = ' '.
      APPEND v_value2 to v_list2.
      PERFORM VALUE USING V_NAME2.
      REFRESH V_LIST3.
      v_name3 = 'P_LOW'.
      v_value3-key = 'Y'.
      v_value3-text = 'Yes'.
      APPEND v_value3 TO v_list3.
      v_value3-key = 'N'.
      v_value3-text = 'No'.
      APPEND v_value3 TO v_list3.
      v_value3-key = ' ' .
      v_value3-text = ''.
      APPEND v_value3 to v_list3.
      PERFORM VALUE USING V_NAME3.
      REFRESH V_LIST4.
      v_name4 = 'P_PARENT'.
      v_value4-key = 'P'.
      v_value4-text = 'Parent'.
      APPEND v_value4 TO v_list4.
      v_value4-key = 'C'.
      v_value4-text = 'Child'.
      APPEND v_value4 TO v_list4.
      v_value4-key = ' ' .
      v_value4-text = ''.
      APPEND v_value4 to v_list4.
      PERFORM VALUE USING V_NAME4.
      REFRESH V_LIST5.
      v_name5 = 'P_PREF'.
      v_value5-key = 'P'.
      v_value5-text = 'Preferred'.
      APPEND v_value5 TO v_list5.
      v_value5-key = 'N'.
      v_value5-text = 'NotPreferred'.
      APPEND v_value5 TO v_list5.
      v_value5-key = ' ' .
      v_value5-text = ''.
      APPEND v_value5 to v_list5.
      PERFORM VALUE USING V_NAME5.
    Now I am getting the same set of values in all the fields.How can I solve this?
    Thanks and Regards,
    Hema

  • BAL_LOG_MSG_CUMULATE.. use of Function module?

    Hi,
    Thanks for spending the time on this Query.
    I need to use this fn.module(BAL_LOG_MSG_CUMULATE). This fun.module is to get cumulating value and this value put into MSG_COUNT in the structure BAL_S_MSG while adding the messages to the log header using the function module(BAL_LOG_MSG_ADD). If I am using the 'cumulate' fn.module What is the major difference while I am adding the messages in the Application log?
    If I am not filling the values in the field 'MSG_COUNT', but messages are added smoothly to the log header.  So, I didn't get what is the use of the Cumulate function module.
    I have very less time to analyses this issue so that, I need to use your time to find out the issue.  Thanks in advance for the advisors.
    Plz advise what is the scenario to use this fun.module?
    Thanks,
    Sridhar Choda.

    this function module creates a message containing whatever text you want but only upto a limit of 200 characters. Actually it cheats the system by creating a message and breaking up the free text into 4 chunks of 50 charatcers, 1 chunk for each of the 4 symsgv variables. It uses message class BL and message 001 which is defined as & & & &, so it's completely free-format.
    If you want to have a bigger field you'll need to use another technique altogether.

  • Why we use this function module

    Hi
        why we use this function module 'LIST_TO_ASCI'.
    regards,
    sivakumar

    hi,
    using LIST_TO_ASCI you can get the list in TEXT format, but this will be with all the formatting you have done in your list, it wont be just field names and its values.
    check this sample code.....
    DATA  BEGIN OF itab_list OCCURS 0.
            INCLUDE STRUCTURE abaplist.
    DATA  END OF itab_list.
    DATA: BEGIN OF vlist OCCURS 0,
            filler1(01)   TYPE c,
            field1(06)    TYPE c,
            filler(08)    TYPE c,
            field2(10)    TYPE c,
            filler3(01)   TYPE c,
            field3(10)    TYPE c,
            filler4(01)   TYPE c,
            field4(3)     TYPE c,
            filler5(02)   TYPE c,
            field5(15)    TYPE c,
            filler6(02)   TYPE c,
            field6(30)    TYPE c,
            filler7(43)   TYPE c,
            field7(10)    TYPE c,
          END OF vlist.
    SUBMIT zreport EXPORTING LIST TO MEMORY.
    CALL FUNCTION 'LIST_FROM_MEMORY'
      TABLES
        listobject = itab_list
      EXCEPTIONS
        not_found  = 4
        OTHERS     = 8.
    CALL FUNCTION 'LIST_TO_ASCI'
      EXPORTING
        list_index         = -1
      TABLES
        listasci           = vlist
        listobject         = itab_list
      EXCEPTIONS
        empty_list         = 1
        list_index_invalid = 2
        OTHERS             = 3.
    IF sy-subrc NE '0'.
      WRITE:/ 'LIST_TO_ASCI error !! ', sy-subrc.
    ENDIF.
    ~~Guduri

  • Spell Check using the function module LXE_SP_CHECKSPELLING_TABLE_MS

    Hi,
    I am using this function module to do a spell check on description and text/note fields. This works great using IC WinClient (SAP GUI). When this is called from IC WebClient (BSP), the function module is returning NO_ACTIVEX error. Did someone encounter the same issue?
    Please let me know.
    Thanks
    Venny

    Hi,
    This might also be of help....
    <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sapportals.km.docs/library/technologies/ms%20word-like%20spell%20checker%20for%20sap%20gui%20fields">https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sapportals.km.docs/library/technologies/ms%20word-like%20spell%20checker%20for%20sap%20gui%20fields</a>
    <b><i>Do reward each useful answer..!</i></b>
    Thanks,
    Tatvagna.

  • Dropdown values are missing while using the function module KCD_EXCEL_OLE_TO_INT_CONVERT

    Hi all,
    when i am trying to upload the excel template by using the function module " KCD_EXCEL_OLE_TO_INT_CONVERT" to an internal table some field values are missing.
    i am using the function module " KCD_EXCEL_OLE_TO_INT_CONVERT"  and i am uploading an excel template and downloading that excel data into an internal table but some field values are missing while uploading the excel template and i found that the field which contains the drop down list values those values are missing.
    And also when i am uploading the excel template by using the function module" KCD_EXCEL_OLE_TO_INT_CONVERT"  when i am coming out of this function module one pop up is coming. how can i avoid this popup, can any one please provide me the solution thanks in advance.
    FYI...it is showing the below popup screen ..
    Thanks,
    Koushik

    hi Feiyun,
    below is the code(highlighted in bold)and after coming out of the function module i am getting popup and also the drop down values are missing.
    DATA: ls_control         TYPE zsfi_fiupload_control,
             ls_header          TYPE zsfi_fiupload_header_v13,
             ls_item            TYPE zsfi_fiupload_item_v13,
             ls_trailer         TYPE zsfi_fiupload_control,
             l_line_count       LIKE zsfi_fiupload_control-rec_count,
             l_current_curr     TYPE kcde_cells-value,
             l_current_postdate TYPE kcde_cells-value,
             l_current_compcode TYPE kcde_cells-value,
             l_currentrow       TYPE kcde_cells-row,
             l_filename         LIKE rlgrap-filename.
       DATA: BEGIN OF lt_intern OCCURS 0.
               INCLUDE STRUCTURE  kcde_cells.
       DATA: END OF lt_intern.
       DATA: BEGIN OF lt_items OCCURS 0,
               a TYPE kcde_cells-value,
               b TYPE kcde_cells-value,
               c TYPE kcde_cells-value,
               d TYPE kcde_cells-value,
               e TYPE kcde_cells-value,
               f TYPE kcde_cells-value,
               g TYPE kcde_cells-value,
               h TYPE kcde_cells-value,
               i TYPE kcde_cells-value,
               j TYPE kcde_cells-value,
               k TYPE kcde_cells-value,
               l TYPE kcde_cells-value,
               m TYPE kcde_cells-value,
               n TYPE kcde_cells-value,
               o TYPE kcde_cells-value,
               p TYPE kcde_cells-value,
               q TYPE kcde_cells-value,
               r TYPE kcde_cells-value,
               s TYPE kcde_cells-value,
               t TYPE kcde_cells-value,
               u TYPE kcde_cells-value,
               v TYPE kcde_cells-value,
               w TYPE kcde_cells-value,
               x TYPE kcde_cells-value,
               y TYPE kcde_cells-value,
               z TYPE kcde_cells-value,
               aa TYPE kcde_cells-value,
               ab TYPE kcde_cells-value,
               ac TYPE kcde_cells-value,
               ad TYPE kcde_cells-value,
               ae TYPE kcde_cells-value,
               af TYPE kcde_cells-value,
               ag TYPE kcde_cells-value,
               ah TYPE kcde_cells-value,
               ai TYPE kcde_cells-value,
               AJ TYPE KCDE_CELLS-VALUE,
               AK TYPE KCDE_CELLS-VALUE,
               END OF lt_items.
       l_filename = p_flpath.
    * the file must be an xls file, not xlsx or comma seperated
       IF p_flpath NS '.xls' AND p_flpath NS '.XLS'.
         MESSAGE i261(zfi).
         g_error = 'X'.
         EXIT.
       ENDIF.
    * upload excel file to a generic table
       CALL FUNCTION 'KCD_EXCEL_OLE_TO_INT_CONVERT'
         EXPORTING
           filename                = l_filename
           i_begin_col             = 1
           i_begin_row             = 1
           i_end_col               = 150
           i_end_row               = 65000
         TABLES
           intern                  = lt_intern
         EXCEPTIONS
           inconsistent_parameters = 1
           upload_ole              = 2
           OTHERS                  = 3.
       IF sy-subrc <> 0.
         MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                 WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
       ENDIF.
    * validate that the format is in the restatement format
    *  this is the only template to have the ledger group in cell G-2
    **  READ TABLE lt_intern WITH KEY row = '0002' col = '0007'.
    **  IF sy-subrc <> 0 OR lt_intern-value IS INITIAL.
    **    MESSAGE i260(zfi).
    **    g_error = 'X'.
    **    EXIT.
    **  ENDIF.
    * create control record values
       ls_control-rec_type = 'C'.
       ls_control-global_id = 'GLU-03000'.
       ls_control-local_id = ''.
       ls_control-rec_count = ''.
       CONCATENATE sy-datum sy-uzeit INTO ls_control-date.
       ls_control-version = '12'.
       ls_control-email = ''.
       ls_control-eor = 'X'.
       ls_trailer = ls_control.
    * open output file and add the control record
       OPEN DATASET p_unixfilename FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
       TRANSFER ls_control TO p_unixfilename.
    * create header record values, will be transfered to file in the item loop
       ls_header-rec_type = 'H'.
       READ TABLE lt_intern WITH KEY row = '0017' col = '0003'.
       IF sy-subrc = 0.
         ls_header-header_txt = lt_intern-value.
       ENDIF.
       READ TABLE lt_intern WITH key row = '0020' col = '0002'.
       IF sy-subrc = 0.
         ls_header-comp_code = lt_intern-value.
       ENDIF.
    ************doc date
       READ TABLE lt_intern WITH KEY row = '0011' col = '0003'.
       IF sy-subrc = 0.
         ls_header-pstng_date = lt_intern-value.
       ENDIF.
    ************posting date
         ls_header-doc_date = sy-datum.
       READ TABLE lt_intern WITH KEY row = '0009' col = '0003'.
       IF sy-subrc = 0.
         ls_header-doc_type = lt_intern-value.
       ENDIF.
       READ TABLE lt_intern WITH KEY row = '0014' col = '0003'.
       IF sy-subrc = 0.
         ls_header-ref_doc_no = lt_intern-value.
       ENDIF.
    ************currency moved to line items
         READ TABLE lt_intern WITH KEY row = '0020' col = '0001'.
       IF sy-subrc = 0.
       ls_header-currency = lt_intern-value.
       ENDIF.
       ls_header-trans_date = ''.
       READ TABLE lt_intern WITH KEY row = '0010' col = '0003'.
       IF sy-subrc = 0.
         ls_header-period = lt_intern-value.
       ENDIF.
       READ TABLE lt_intern WITH KEY row = '0006' col = '0003'.
       IF sy-subrc = 0.
         ls_header-reason_rev = lt_intern-value.
       ENDIF.
       READ TABLE lt_intern WITH KEY row = '0007' col = '0003'.
       IF sy-subrc = 0.
         ls_header-rev_date = lt_intern-value.
       ENDIF.
    *  READ TABLE lt_intern WITH KEY row = '0002' col = '0007'.
    *  IF sy-subrc = 0.
         ls_header-ledger_grp = ''.
    *  ENDIF.
    *  READ TABLE lt_intern WITH KEY row = '0013' col = '0013'.
    *  IF sy-subrc = 0.
         ls_header-exch_rate = ''.
    *  ENDIF.
       READ TABLE lt_intern WITH KEY row = '0008' col = '0003'.
       IF sy-subrc = 0.
         ls_header-calc_tax = lt_intern-value.
       ENDIF.
       ls_header-eor = 'X'.
    * loop at the line items and append them to a table with multiple columns
       LOOP AT lt_intern WHERE row GE 20.
         IF l_currentrow <> lt_intern-row AND l_currentrow IS NOT INITIAL.
           APPEND lt_items.
           CLEAR lt_items.
         ENDIF.
         l_currentrow = lt_intern-row.
         CASE lt_intern-col.
           WHEN '0001'. lt_items-a = lt_intern-value.
           WHEN '0002'. lt_items-b = lt_intern-value.
           WHEN '0003'. lt_items-c = lt_intern-value.
           WHEN '0004'. lt_items-d = lt_intern-value.
           WHEN '0005'. lt_items-e = lt_intern-value.
           WHEN '0006'. lt_items-f = lt_intern-value.
           WHEN '0007'. lt_items-g = lt_intern-value.
           WHEN '0008'. lt_items-h = lt_intern-value.
           WHEN '0009'. lt_items-i = lt_intern-value.
           WHEN '0010'. lt_items-j = lt_intern-value.
           WHEN '0011'. lt_items-k = lt_intern-value.
           WHEN '0012'. lt_items-l = lt_intern-value.
           WHEN '0013'. lt_items-m = lt_intern-value.
           WHEN '0014'. lt_items-n = lt_intern-value.
           WHEN '0015'. lt_items-o = lt_intern-value.
           WHEN '0016'. lt_items-p = lt_intern-value.
           WHEN '0017'. lt_items-q = lt_intern-value.
           WHEN '0018'. lt_items-r = lt_intern-value.
           WHEN '0019'. lt_items-s = lt_intern-value.
           WHEN '0020'. lt_items-t = lt_intern-value.
           WHEN '0021'. lt_items-u = lt_intern-value.
           WHEN '0022'. lt_items-v = lt_intern-value.
           WHEN '0023'. lt_items-w = lt_intern-value.
           WHEN '0024'. lt_items-x = lt_intern-value.
           WHEN '0025'. lt_items-y = lt_intern-value.
           WHEN '0026'. lt_items-z = lt_intern-value.
           WHEN '0027'. lt_items-aa = lt_intern-value.
           WHEN '0028'. lt_items-ab = lt_intern-value.
           WHEN '0029'. lt_items-ac = lt_intern-value.
           WHEN '0030'. lt_items-ad = lt_intern-value.
           WHEN '0031'. lt_items-ae = lt_intern-value.
           WHEN '0032'. lt_items-af = lt_intern-value.
           WHEN '0033'. lt_items-ag = lt_intern-value.
           WHEN '0034'. lt_items-ah = lt_intern-value.
           WHEN '0035'. lt_items-ai = lt_intern-value.
           when '0036'. lt_items-aj = lt_intern-value.
           when '0037'. lt_items-ak = lt_intern-value.
         ENDCASE.
       ENDLOOP.
       APPEND lt_items.
    * sort rows by the post date, comp code, curr.
    *  SORT lt_items BY ah a ai.
    * loop at the items, creating a header record if the comp code, curr. or post date changes
       LOOP AT lt_items.
         ls_item-rec_type = 'I'.
         ls_item-post_key = lt_items-c.   "lt_items-b.
         IF lt_items-c GE '20' AND lt_items-c LE '39'.
           ls_item-vendor_no = lt_items-d.
         ELSEIF lt_items-c GE '0' AND lt_items-c LE '19'.
           ls_item-customer = lt_items-d.
         ELSEIF lt_items-c EQ '70' AND lt_items-c EQ '75'.
           ls_item-asset = lt_items-d.
         ELSE.
           ls_item-gl_account = lt_items-d.
         ENDIF.
         ls_item-asset_type = lt_items-m. "lt_items-l.
         ls_item-trans_type = lt_items-n. "lt_items-m.
         ls_item-print_flag = ''.
         ls_item-item_text = lt_items-j. "lt_items-i.
         ls_item-comp_code = lt_items-b. "lt_items-a.
         ls_item-bus_area = ''.
         ls_item-alloc_nmbr = lt_items-l. "lt_items-k.
         ls_item-tax_code = lt_items-q. "lt_items-p.
         ls_item-taxjurcode = lt_items-r. "lt_items-q.
         ls_item-profit_ctr = lt_items-g. "lt_items-f.
         ls_item-costcenter = lt_items-h. "lt_items-g.
         ls_item-orderid = lt_items-ac. "lt_items-ab.
         ls_item-wbs = lt_items-i. "lt_items-h.
         ls_item-trade_id = lt_items-o. "lt_items-n.
         ls_item-part_prctr = lt_items-p. "lt_items-o.
         ls_item-material = lt_items-t. "lt_items-s.
         ls_item-salesorg = lt_items-aa. "lt_items-z.
         ls_item-distr_chan = lt_items-ab. "lt_items-aa.
         ls_item-pmnttrms = ''.
         ls_item-pmtmthd = ''.
         ls_item-pmtmthsupl = ''.
         ls_item-alt_payee = ''.
         REPLACE ALL OCCURRENCES OF '(' IN lt_items-e WITH ''.
         REPLACE ALL OCCURRENCES OF ')' IN lt_items-e WITH ''.
         ls_item-amt_doccur = lt_items-e. "lt_items-d
         REPLACE ALL OCCURRENCES OF '(' IN lt_items-f WITH ''.
         REPLACE ALL OCCURRENCES OF ')' IN lt_items-f WITH ''.
         ls_item-loc_amt = lt_items-f. "lt_items-e
         ls_item-loc  = lt_items-k. "lt_items-j.
         ls_item-sas_revtype = lt_items-s. "lt_items-r.
         ls_item-rev_type = lt_items-u. "lt_items-t.
         ls_item-rev_chnl = lt_items-v. "lt_items-u.
         ls_item-bill_to = lt_items-x. "lt_items-w.
         ls_item-payer = lt_items-z. "lt_items-y.
         ls_item-ship_to = lt_items-y.
         ls_item-tax_amnt = lt_items-x.
         ls_item-func_area = ''.
         ls_item-expend_date = lt_items-ae. "lt_items-ad.
         ls_item-wtax_code = lt_items-af. "lt_items-ae.
         ls_item-wtax_base = lt_items-ag. "lt_items-af.
         ls_item-wtax_amount = lt_items-ah. "lt_items-ag.
         ls_item-payment_block = ''.
         ls_item-grp_amt = ''.
         ls_item-anc_amt = ''.
         ls_item-permit_payee = ''.
         ls_item-value_date = ''.
         ls_item-pernr   = ''.
         ls_item-legacy1 = ''.
         ls_item-legacy2 = ''.
         ls_item-legacy3 = ''.
         ls_item-legacy4 = ''.
         ls_item-legacy5 = ''.
         ls_item-legacy6 = ''.
         ls_item-legacy7 = ''.
         ls_item-legacy8 = ''.
         ls_item-legacy9 = ''.
         ls_item-legacy10 = ''.
         ls_item-eor = 'X'.
         TRANSLATE lt_items-ai TO UPPER CASE.
         TRANSLATE lt_items-b TO UPPER CASE.
         TRANSLATE lt_items-a TO UPPER CASE.
         TRANSLATE lt_items-aj TO UPPER CASE.
         IF l_current_curr <> lt_items-a "lt_items-ai
           OR l_current_postdate <> ls_header-pstng_date "lt_items-aj
           OR l_current_compcode <> lt_items-b.
           l_current_curr = lt_items-a.
           l_current_postdate = ls_header-pstng_date. "lt_items-aj.
           l_current_compcode = lt_items-b.
           ls_header-comp_code = l_current_compcode.
           ls_header-currency = l_current_curr.
           ls_header-pstng_date = l_current_postdate.
           ls_header-doc_date = l_current_postdate.
           TRANSFER ls_header TO p_unixfilename.
           l_line_count = l_line_count + 1.
         ENDIF.
         TRANSFER ls_item TO p_unixfilename.
         l_line_count = l_line_count + 1.
       ENDLOOP.
       ls_trailer-rec_type = 'T'.
       ls_trailer-rec_count = l_line_count.
       TRANSFER ls_trailer TO p_unixfilename.
       CLOSE DATASET p_unixfilename.
    * change the format to fixed format for the remainder of the load program
       p_fixed = 'X'.
       p_rstmnt = ''.
    Thanks,
    Koushik

  • How to use read_text function module

    Hi how to use read_text function module to read purchase order header text .what are all tht things to pass in ID,Name and Object
    thanks,
    Mahe

    Dear,
    Use below code.
    DATA:IT_LINE LIKE TLINE OCCURS 0 WITH HEADER LINE,
    V_TDNAME LIKE THEAD-TDNAME.
    V_TDNAME = PO_NUMBER.
    CALL FUNCTION 'READ_TEXT'
      EXPORTING
    *   CLIENT                        = SY-MANDT
        ID                            = 'F01'
        LANGUAGE                      = 'EN'
        NAME                          = V_TDNAME
        OBJECT                        = 'EKKO'
      TABLES
        LINES                         = IT_LINE.
    Thanks and Regards,

  • How to avoid use of function module in case of background jobs?

    Hi ,
           I am working a file tranfer interface .Functionality is to extract file either apllication or presentation server , and process the file  through bapi , send the  result in their respective server. This program should run through batch jobs in background mode.
    I am using following function module :
      SUBST_GET_FILE_LIS : Get the file list from application server
    TMP_GUI_DIRECTORY_LIST_FILES : Get the file list from presentation server
    GUI_UPLOad : to extract file data   from presentation server
    GUI_downLOAD : to download data  to presentation server
    in case of background job these function modules will not work.... so how to resolve this issue...
    what are the methods we can apply?
    Thanks & Regards
    Sandeep

    Hi,
    This FM is used to get list of files from Application server (will work in Background). This cannot be used to list files from presentation server.  There is no way , by which you can process presentation server files in background mode.
    Regards
    Vinod

  • How can i use reuse_alv_fieldcatalog_merge function module

    I am using below steps for populating the final internal table.How can I use reuse_alv_fieldcatalog_merge function module in the place of declaring all these fields.How canI put title of the report in reuse_alv_fieldcatalog_merge function module.
    FORM BUILD_FIELDCATALOG .
      FIELDCAT-TABNAME   = 'IT_FINAL'.
      FIELDCAT-FIELDNAME = 'KUNNR'.
      FIELDCAT-SELTEXT_M = 'Customer Name'.
      FIELDCAT-JUST      = 'L'.
      FIELDCAT-KEY       = 'X'.
      FIELDCAT-DATATYPE  = 'C'.
      APPEND FIELDCAT TO I_FIELDCAT.
      CLEAR FIELDCAT.
      FIELDCAT-TABNAME   = 'IT_FINAL'.
      FIELDCAT-FIELDNAME = 'VBELN'.
      FIELDCAT-SELTEXT_M = 'Invoice Reference'.
      FIELDCAT-JUST      = 'L'.
      FIELDCAT-KEY       = 'X'.
      APPEND FIELDCAT TO I_FIELDCAT.
      CLEAR FIELDCAT.
      FIELDCAT-TABNAME   = 'IT_FINAL'.
      FIELDCAT-FIELDNAME = 'VKBUR'.
      FIELDCAT-SELTEXT_M = 'Sales Office'.
      FIELDCAT-JUST      = 'L'.
    FIELDCAT-KEY       = 'X'.
      FIELDCAT-DATATYPE  = 'C'.
      APPEND FIELDCAT TO I_FIELDCAT.
      CLEAR FIELDCAT.
      FIELDCAT-TABNAME   = 'IT_FINAL'.
      FIELDCAT-FIELDNAME = 'VKGRP'.
      FIELDCAT-SELTEXT_M = 'Sales Person'.
      FIELDCAT-JUST      = 'L'.
    FIELDCAT-KEY       = 'X'.
      FIELDCAT-DATATYPE  = 'C'.
      APPEND FIELDCAT TO I_FIELDCAT.
      CLEAR FIELDCAT.
      FIELDCAT-TABNAME   = 'IT_FINAL'.
      FIELDCAT-FIELDNAME = 'POSNR'.
      FIELDCAT-SELTEXT_M = 'Item No'.
      FIELDCAT-JUST      = 'L'.
      FIELDCAT-KEY       = 'X'.
      APPEND FIELDCAT TO I_FIELDCAT.
      CLEAR FIELDCAT.
      FIELDCAT-TABNAME   = 'IT_FIANL'.
      FIELDCAT-FIELDNAME = 'ARKTX'.
      FIELDCAT-SELTEXT_M = 'Item Description'.
      FIELDCAT-JUST      = 'L'.
      FIELDCAT-DATATYPE  = 'C'.
      APPEND FIELDCAT TO I_FIELDCAT.
      CLEAR FIELDCAT.

    Hello,
    It is very easy to use reuse_alv_fieldcatalog_merge.
    You try this it will work.
    example
    data:
    DATA : gv_repid        TYPE syrepid VALUE sy-repid .  " Report id
      PERFORM set_field_catalog USING gst_struct CHANGING lst_fieldcat.
    FORM set_field_catalog  USING uv_tab TYPE slis_tabname
                         CHANGING  xt_fieldcatalog TYPE slis_t_fieldcat_alv.
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
        EXPORTING
          i_program_name         = gv_repid
          i_internal_tabname     = uv_tab
          i_inclname             = gv_repid
        CHANGING
          ct_fieldcat            = xt_fieldcatalog
        EXCEPTIONS
          inconsistent_interface = 1
          program_error          = 2
          OTHERS                 = 3.
      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.                    " set_field_catalog_spec

  • How to EDIT a particular Row in ALV using normal function module Reuse_alv_grid_display

    Hi experts..
    i got one requirement like i need to edit some rows particularly in alv....
    Edit in alv output....is it possible to get  that .....using normal function module with out using oops concept...
    could any one pls help me...

    Hi Pendurti ,
    If you want a particular field to be editable , simply define the fieldcatalog as
    wa_fieldcatalog-edit          = 'X'.
    wa_fieldcatalog-input         = 'X'.
    for that field.
    and
    Now when you use FM ' Reuse alv grid display '
    define USER_COMMAND
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program       = v_repid
          i_callback_pf_status_set = 'SET_PF_STATUS'
          i_callback_user_command  = 'USER_COMMAND'
          it_fieldcat              = int_fieldcatalog
          is_layout                = wa_layout
        TABLES
          t_outtab                 = t_disp.
    and now in form USER_COMMAND ; code as per following
    FORM user_command  USING r_ucomm LIKE sy-ucomm
                                rs_selfield TYPE slis_selfield.
         DATA ref1 TYPE REF TO cl_gui_alv_grid.
         CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
           IMPORTING
             e_grid = ref1.
         CALL METHOD ref1->check_changed_data.
    endform.
    Regards,
    Yogendra Bhaskar

Maybe you are looking for