How to save message into internal table?

Hi,everyone!
I have a problem when I'm coding.I want to store messages into a internal table.Can you help me?
Thanks!

Hello Feng
If you are already working on SAP basis release >= 6.20 I would recommend the most versatile message handler of all: interface <b>IF_RECA_MESSAGE_LIST</b>
Perhaps you will find the following sample report ZUS_SDN_APOLLO_13
(see also: <a href="https://wiki.sdn.sap.com/wiki/display/profile/2007/07/09/MessageHandling-FindingtheNeedleintheHaystack">Message Handling - Finding the Needle in the Haystack</a>) useful.
*& Report  ZUS_SDN_APOLLO_13
REPORT  zus_sdn_apollo_13
  LINE-SIZE 200.
TYPE-POOLS: abap.
TYPES: BEGIN OF ty_s_outtab.
TYPES:   status     TYPE exception.
INCLUDE TYPE bapiret2  AS msg.
TYPES: END OF ty_s_outtab.
TYPES: ty_t_outtab  TYPE STANDARD TABLE OF ty_s_outtab
                    WITH DEFAULT KEY.
DATA:
  gs_layout         TYPE lvc_s_layo,
  gt_outtab         TYPE ty_t_outtab.
DATA:
  gd_title          TYPE lvc_title,
  gd_msgv           TYPE symsgv,
  gd_msg            TYPE bapi_msg,
  gs_msg            TYPE recamsg,
  gs_return         TYPE bapiret2,
  gt_return         TYPE bapirettab,
  go_msglist        TYPE REF TO if_reca_message_list,
  go_random         TYPE REF TO cl_random_number,
  gif_random        TYPE REF TO if_random_number.
PARAMETERS:
  p_opt1  RADIOBUTTON GROUP radi  DEFAULT 'X',
  p_opt2  RADIOBUTTON GROUP radi,
  p_opt3  RADIOBUTTON GROUP radi.
SELECTION-SCREEN ULINE.
PARAMETERS:
  p_opt4  RADIOBUTTON GROUP radi,
  p_opt5  RADIOBUTTON GROUP radi,
  p_opt6  RADIOBUTTON GROUP radi.
SELECTION-SCREEN ULINE.
PARAMETERS:
  p_count    TYPE numc3     DEFAULT '4',
  p_level    TYPE ballevel  DEFAULT '7'.
DEFINE mac_build_msg.
  clear: gs_msg.
  gs_msg-msgty = &5.
  gs_msg-msgid = '00'.
  gs_msg-msgno = '398'.
  gs_msg-msgv1 = &1.
  gs_msg-msgv2 = &2.
  gs_msg-msgv3 = &3.
  gs_msg-msgv4 = &4.
  gs_msg-detlevel = &6.
END-OF-DEFINITION.
*  msgty
*  msgid
*  msgno
*  msgv1
*  msgv2
*  msgv3
*  msgv4
*  msgv1_src
*  msgv2_src
*  msgv3_src
*  msgv4_src
*  detlevel
*  probclass
*  alsort
*  time_stmp
*  msg_count
*  context
*  params
START-OF-SELECTION.
  " Create message handler
  go_msglist = cf_reca_message_list=>create( ).
  " Create random number instance
  CREATE OBJECT go_random TYPE cl_random_number.
  gif_random ?= go_random.
  gif_random->init( ).
  PERFORM message_handling_1.
  PERFORM message_handling_2.
  PERFORM message_handling_3.
  PERFORM message_handling_4.
END-OF-SELECTION.
*&      Form  MESSAGE_HANDLING_1
*       text
*  -->  p1        text
*  <--  p2        text
FORM message_handling_1 .
  CHECK ( p_opt1 = abap_true ).
  gd_title = 'Information System 1 (IS1)'.
  SET TITLEBAR 'TITLE' WITH gd_title.
  WRITE: / 'Apollo 13 Mission'.
  WRITE: / syst-uline.
  WRITE: / 'Take-Off             -> ok'.
  WRITE: / 'Leaving Orbit        -> ok'.
  WRITE: / 'Trajectory           -> ok'.
  WRITE: /.
  FORMAT COLOR COL_NEGATIVE.
  WRITE: / 'Explosion happened   -> not ok'.
  WRITE: / 'Command and Service module (CSM) -> damaged'.
  FORMAT RESET.
  WRITE: / 'Lunar module (LM)    -> not affected, ok'.
  MESSAGE text-hou TYPE 'S'.
ENDFORM.                    " MESSAGE_HANDLING_1
*&      Form  message_handling_2
*       text
*  -->  p1        text
*  <--  p2        text
FORM message_handling_2 .
* define local data
  DATA:
    ld_success(6)  TYPE n,
    ld_warning(6)  TYPE n,
    ld_failure(6)  TYPE n,
    ld_total(6)    TYPE n.
  CHECK ( p_opt2 = abap_true ).
  gd_title = 'Information System 2 (IS2)'.
  SET TITLEBAR 'TITLE' WITH gd_title.
  PERFORM generate_messages.  " simulation of messages
  CALL METHOD go_msglist->get_list_as_bapiret
    IMPORTING
      et_list = gt_return.
  " Calculate message types and total
  ld_total   = 0.
  ld_success = 0.
  ld_warning = 0.
  ld_failure = 0.
" Print messages as WRITE list
  LOOP AT gt_return INTO gs_return.
    IF ( gs_return-type = 'E' ).
      ADD 1 TO ld_failure.
    ELSEIF ( gs_return-type = 'W' ).
      ADD 1 TO ld_warning.
    ELSE.
      ADD 1 TO ld_success.
    ENDIF.
  ENDLOOP.
  ld_total = ld_success + ld_warning + ld_failure.
  WRITE: / 'Total Message =', ld_total.
  WRITE: / 'Failures      =', ld_failure.
  WRITE: / 'Warnings      =', ld_warning.
  WRITE: / 'Successes     =', ld_success.
  WRITE: / syst-uline.
  SKIP.
" Colouring depending on message type
  LOOP AT gt_return INTO gs_return.
    IF ( gs_return-type = 'E' ).
      FORMAT COLOR COL_NEGATIVE.
    ELSEIF ( gs_return-type = 'W' ).
      FORMAT COLOR COL_TOTAL.
    ELSE.
      FORMAT RESET.
    ENDIF.
    WRITE: / gs_return-type, gs_return-message+0(100).
  ENDLOOP.
ENDFORM.                    " message_handling_2
*&      Form  message_handling_3
*       text
*  -->  p1        text
*  <--  p2        text
FORM message_handling_3 .
* define local data
  DATA:
    ls_outtab    TYPE ty_s_outtab.
  DATA:
    ld_success(6)  TYPE n,
    ld_warning(6)  TYPE n,
    ld_failure(6)  TYPE n,
    ld_total(6)    TYPE n.
  CHECK ( p_opt3 = abap_true ).
  gd_title = 'Information System 3 (IS3)'.
  SET TITLEBAR 'TITLE' WITH gd_title.
  PERFORM generate_messages.  " simulation of messages
  CALL METHOD go_msglist->get_list_as_bapiret
    IMPORTING
      et_list = gt_return.
  REFRESH: gt_outtab.
  " Calculate message types and total
  ld_total   = 0.
  ld_success = 0.
  ld_warning = 0.
  ld_failure = 0.
" Define the logic for setting exception status (LED)
  LOOP AT gt_return INTO gs_return.
    CLEAR: ls_outtab.
    ls_outtab-msg = gs_return.
    IF ( gs_return-type = 'E' ).
      ls_outtab-status = '1'.  " red
      ADD 1 TO ld_failure.
    ELSEIF ( gs_return-type = 'W' ).
      ls_outtab-status = '2'.  " yellow
      ADD 1 TO ld_warning.
    ELSE.
      ls_outtab-status = '3'.  " green
      ADD 1 TO ld_success.
    ENDIF.
    APPEND ls_outtab TO gt_outtab.
  ENDLOOP.
  ld_total = ld_failure + ld_warning + ld_success.
  CLEAR: gs_layout.
  gs_layout-cwidth_opt = abap_true.
  gs_layout-zebra      = abap_true.
  gs_layout-excp_fname = 'STATUS'.
  gs_layout-excp_led   = abap_true.
  gs_layout-smalltitle = abap_true.
  CONCATENATE 'T(' ld_total   ')  '
              'E(' ld_failure ')  '
              'W(' ld_warning ')  '
              'S(' ld_success ')  '
    INTO gd_title SEPARATED BY space.
  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
    EXPORTING
      i_structure_name = 'BAPIRET2'
      i_grid_title     = gd_title
      is_layout_lvc    = gs_layout
    TABLES
      t_outtab         = gt_outtab
    EXCEPTIONS
      OTHERS           = 1.
ENDFORM.                    " message_handling_3
*&      Form  message_handling_4
*       text
*  -->  p1        text
*  <--  p2        text
FORM message_handling_4 .
* define local data
  CHECK ( p_opt4 = abap_true   OR
          p_opt5 = abap_true   OR
          p_opt6 = abap_true ).
  IF ( p_opt4 = abap_true ).
    gd_title = 'Information System 4 (IS4)'.
    SET TITLEBAR 'TITLE' WITH gd_title.
  ELSEIF ( p_opt5 = abap_true ).
    gd_title = 'Information System 5 (IS5)'.
    SET TITLEBAR 'TITLE' WITH gd_title.
  ELSE.
    gd_title = 'Information System 6 (IS6)'.
    SET TITLEBAR 'TITLE' WITH gd_title.
  ENDIF.
  PERFORM generate_messages.  " simulation of messages
  PERFORM display_log.
ENDFORM.                    " message_handling_4
*&      Form  GENERATE_MESSAGES
*       text
*  -->  p1        text
*  <--  p2        text
FORM generate_messages .
* define local data
  mac_build_msg 'Apollo 13 Mission: Spacecraft'
                 space space space 'I' '1'.
**  DEFINE mac_build_msg.
**    clear: gs_msg.
**    gs_msg-msgty = &5.
**    gs_msg-msgid = '00'.
**    gs_msg-msgno = '398'.
**    gs_msg-msgv1 = &1.
**    gs_msg-msgv2 = &2.
**    gs_msg-msgv3 = &3.
**    gs_msg-msgv4 = &4.
**    gs_msg-detlevel = &6.
**  END-OF-DEFINITION.
  go_msglist->add( is_message = gs_msg ).
  DO 6 TIMES.
    CASE syst-index.
      WHEN '1'.
        mac_build_msg 'Command and Service Module (CSM)'
           space space space 'I' '2'.
      WHEN '2'.
        mac_build_msg 'Lunar Module (LM)' space space space 'I' '2'.
      WHEN '3'.
        mac_build_msg 'Additional Module (M-1)'
          space space space 'I' '2'.
      WHEN '4'.
        mac_build_msg 'Additional Module (M-2)'
          space space space 'I' '2'.
      WHEN '5'.
        mac_build_msg 'Additional Module (M-3)'
          space space space 'I' '2'.
      WHEN '6'.
        mac_build_msg 'Additional Module (M-4)'
          space space space 'I' '2'.
      WHEN OTHERS.
        EXIT.
    ENDCASE.
    go_msglist->add( is_message = gs_msg ).
"   recursive call of routine
    PERFORM generate_messages_1 USING syst-index 'Modul' '3'.
  ENDDO.
ENDFORM.                    " GENERATE_MESSAGES
*&      Form  GENERATE_MESSAGES_1
*       text
*  -->  p1        text
*  <--  p2        text
FORM generate_messages_1
                     USING
                        value(ud_index)     TYPE i
                        value(ud_msgv)      TYPE symsgv
                        value(ud_detlevel)  TYPE ballevel.
* define local data
  DATA:
    ld_integer         TYPE i,
    ld_msgty           TYPE symsgty,
    ld_msgv            TYPE symsgv,
    ld_detlevel        TYPE ballevel.
  DO p_count TIMES.
    WRITE syst-index TO ld_msgv NO-ZERO LEFT-JUSTIFIED.
    IF ( ud_detlevel = '3' ).
      CONCATENATE ud_msgv ld_msgv INTO ld_msgv
        SEPARATED BY space.
    ELSE.
      CONCATENATE ud_msgv ld_msgv INTO ld_msgv
        SEPARATED BY '.'.
    ENDIF.
    CONDENSE ld_msgv.
    gd_msgv = ld_msgv.
    IF ( ud_index = 1 ).
      ld_integer = gif_random->get_random_int( 300 ).
      IF ( ld_integer = 1 ).
        ld_msgty = 'E'.
        CONCATENATE gd_msgv 'failed' INTO gd_msgv SEPARATED BY ' -> '.
      ELSEIF ( ld_integer BETWEEN 1 AND 10 ).
        ld_msgty = 'W'.
        CONCATENATE gd_msgv 'check(?)' INTO gd_msgv SEPARATED BY ' -> '.
      ELSE.
        ld_msgty = 'S'.
        CONCATENATE gd_msgv 'OK' INTO gd_msgv SEPARATED BY ' -> '.
      ENDIF.
    ELSE.
      ld_msgty = 'S'.
      CONCATENATE gd_msgv 'OK' INTO gd_msgv SEPARATED BY ' -> '.
    ENDIF.
    mac_build_msg gd_msgv space space space ld_msgty ud_detlevel.
    go_msglist->add( is_message = gs_msg ).
    IF ( ud_detlevel < p_level ).
      ld_detlevel = ud_detlevel + 1.
      PERFORM generate_messages_1 USING ud_index ld_msgv ld_detlevel.
    ENDIF.
  ENDDO.
ENDFORM.                    " GENERATE_MESSAGES_1
*&      Form  DISPLAY_LOG
*       text
*  -->  p1        text
*  <--  p2        text
FORM display_log .
* define local data
  DATA:
    ld_handle           TYPE balloghndl,
    lt_log_handles      TYPE bal_t_logh,
    ls_profile          TYPE bal_s_prof.
" Get log handle of collected message list
  ld_handle = go_msglist->get_handle( ).
  APPEND ld_handle TO lt_log_handles.
  IF ( p_opt4 = 'X' ).
*   get a display profile which describes how to display messages
    CALL FUNCTION 'BAL_DSP_PROFILE_DETLEVEL_GET'
      IMPORTING
        e_s_display_profile = ls_profile.  " tree & ALV list
  ELSEIF ( p_opt5 = 'X' ).
*   get standard profile to display one log
    CALL FUNCTION 'BAL_DSP_PROFILE_SINGLE_LOG_GET'
      IMPORTING
        e_s_display_profile = ls_profile.
  ELSE.
    CALL FUNCTION 'BAL_DSP_PROFILE_NO_TREE_GET'
      IMPORTING
        e_s_display_profile = ls_profile.
  ENDIF.
* set report to allow saving of variants
  ls_profile-disvariant-report = sy-repid.
*   when you use also other ALV lists in your report,
*   please specify a handle to distinguish between the display
*   variants of these different lists, e.g:
  ls_profile-disvariant-handle = 'LOG'.
  CALL FUNCTION 'BAL_DSP_LOG_DISPLAY'
    EXPORTING
      i_s_display_profile          = ls_profile
      i_t_log_handle               = lt_log_handles
    EXCEPTIONS
      profile_inconsistent         = 1
      internal_error               = 2
      no_data_available            = 3
      no_authority                 = 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.                    " DISPLAY_LOG
Regards
  Uwe

Similar Messages

  • Collect message into internal table

    Hi,
    does any one knows how BAPIs or CALL TRANSACTIONs collect messages into internal table.
    My problem is that some BI with CALL TRANSACTION doesn't collect right message into return table and I would like to collect this last message after CALL TRANSACTION and therefore be sure that everything went OK.....
    thx
    mario

    hi
    good
    check this
    Call Transaction p_trans using ZBDC_Table
                                   Mode p_mode
                                 Update p_update
                          Messages into p_messages.
         Move sy-subrc to w__subrc.
       Scan the messages in YDCRAISES to see if we need to
       change the message class.
         Loop at p_messages.
              Select single msgtyp
                into w__msgtp
                from zdcraise
               where tcode  = p_messages-tcode  and
                     msgid  = p_messages-msgid  and
                     msgnr  = p_messages-msgnr.
              If sy-subrc = 0.
                 Move w__msgtp to p_messages-msgtyp.
                 Modify p_messages.
              EndIf.
         EndLoop.
       Dump the message table ?
         If w__ydcset-dumpmsg = True.
    thanks
    mrutyun^

  • HOW TO CONVERT STRUCTURE INTO INTERNAL TABLE

    HOW TO CONVERT STRUCTURE INTO INTERNAL TABLE

    lets declare a structure --
    data: begin of str,
          name(10),
          age(3),
          city(10),
          end of str.
    lets now convert this to an internal table itab --
    data itab like table of str.
    I hope this helps
    regards,
    -pankaj singh

  • How to Fetch Data into internal table column wise?

    The internal table contains huge set of data. Normally we fetch the data row wise using insert and select statements in work area.
    But, the requirement is on fetching the data column wise for each field from the database.
    So,can anyone help me on this issue for fetching the data column wise?

    Welcome to SDN.
    What you want to do(if I understand correctly) is not possible with the statements available to us.  You could do it, but I think it would be a lot of code and I don't think that its worth it.  Why exactly do you want to do this?
    Regards,
    Rich Heilman

  • Converting worbook data into internal table

    Hi,
    I'm using a FM 'RRMX_WORKBOOK_READ'  to read data from a workbook in BI system. My requirement is to get the data into an internal table and I'm using the above FM for this purpose. But the above FM gives data in binary format.... Anbody has any idea how to convert this into internal table format.
    Thanks,
    Mahesh M.S.

    get the spool output in raw format using function module
    data: it_raw type table of soli.
        call function 'RSPO_RETURN_SPOOLJOB'
          exporting
            rqident                    = i_spool_nr
      FIRST_LINE                  = 1
      LAST_LINE                   = 1000000000000
           desired_type             = 'RAW'
    IMPORTING
      REAL_TYPE                  =
      SP_LANG                    =
          tables
            buffer                     = it_raw
      BUFFER_PDF                 =
    exceptions
       no_such_job                = 1
       job_contains_no_data       = 2
       selection_empty            = 3
       no_permission              = 4
       can_not_access             = 5
       read_error                 = 6
       type_no_match              = 7
       others                     = 8.
    if  the required format is XLS add tabs to split the columns.
      constants  con_tab  type c value cl_abap_char_utilities=>horizontal_tab.
      if i_doctype = 'XLS'.
        replace all occurrences of '|' in table t_attachment with con_tab.
      endif.
    Then use  'SO_DOCUMENT_SEND_API1' fucntion module to send XLS file as attachment

  • Fetch data into internal table

    Hi all,
    I want to fetch all the opbel records from erdk table into an intrnal table.
    Only opbel records.There are 100000000 records in erdk table.
    How can I fetch into internal table ? what statement can I use to fetch the data faster keepin performance into consideration ?
    Many thanks

    Hi,
    As far as data fetch is concerned you do the same as follows:
    Select * from erdk into table itab
    where..... < Your Where Condition if any>.
    But as the number of records are very high, first try to put all the primary keys in the where clause and also if possible, try to narrow down the selection criteria by fetching data from some other table or widening the conditions in where clause.
    Also try to fetch only thode fields which you actually need.
    else your program will give performance problems.
    Hope this helps!
    Regards,
    Lalit

  • How to transfer excel files(on ftp server) into internal table?

    hello,everyone
    pls tell me how to transfer excel files those on a ftp server into internal table?
    ps.i know the function 'ftp_server_to_r3',it can help to transfer flat file.

    Hi,
    I believe you want to get the data from the FTP Server to R3.
    I am also sending the code. Have a look and it would help you.
    First get the Password and user name and the FTP Server Path where file is stored and FTP Server Host name
    FUNCTION zfi_ftp_get.
    *"*"Local Interface:
    *"  IMPORTING
    *"     VALUE(I_FILENAME) TYPE  C
    *"  TABLES
    *"      T_BLOB STRUCTURE  ZFI_TLM_LENGTH OPTIONAL " is a table type with a field called line of length 992
    *"      RETURN STRUCTURE  BAPIRET2 OPTIONAL
      DATA : i_password(30)     TYPE c,
             i_user(30)         TYPE c,
             i_host(30)         TYPE c,
             i_rfc_destination  TYPE rfcdes-rfcdest,
             i_length           TYPE i,
             i_folder_path(100) TYPE c.
      DATA:   lv_blob_length   TYPE i.
      DATA:   lv_length        TYPE i,  "Password length
              lv_key           TYPE i VALUE 26101957,
              lv_password(30)  TYPE c,
              lv_ftp_handle    TYPE i,
              lv_cmd(80)       TYPE c.
      DATA: BEGIN OF result OCCURS 0,
            line(100) TYPE c,
            END OF result.
      TYPES: BEGIN OF ty_dummy,
             line(392) TYPE c,
           END   OF ty_dummy.
      DATA: lt_dummy TYPE TABLE OF ty_dummy,
            ls_dummy LIKE LINE  OF lt_dummy.
      i_password        = 'vnhdh'.
      i_user            = 'sdkgd'.
      i_host            = 'sbnksbg'.
      i_rfc_destination = 'SAPFTP'.
      i_length          = '992'.
      i_folder_path     = '/hioj/hohjk/hh'.
      lv_length = STRLEN( i_password ).
      CALL FUNCTION 'HTTP_SCRAMBLE'
        EXPORTING
          SOURCE      = i_password
          sourcelen   = lv_length
          key         = lv_key
        IMPORTING
          destination = lv_password.
      CALL FUNCTION 'FTP_CONNECT'
        EXPORTING
          user            = i_user
          password        = lv_password
          host            = i_host
          rfc_destination = i_rfc_destination
        IMPORTING
          handle          = lv_ftp_handle
        EXCEPTIONS
          not_connected   = 1
          OTHERS          = 2.
      IF sy-subrc = 1.
        return-type = 'E' .
        return-message = 'FTP Connection not Successful'.
        APPEND return.
      ELSEIF sy-subrc = 2.
        return-type = 'E' .
        return-message = 'FTP Connection not Successful'.
        APPEND return.
      ELSEIF sy-subrc EQ 0.
        return-type = 'S' .
        return-message = 'FTP Connection Successful'.
        APPEND return.
        CONCATENATE 'cd' i_folder_path INTO lv_cmd SEPARATED BY space.
        CALL FUNCTION 'FTP_COMMAND'
          EXPORTING
            handle        = lv_ftp_handle
            command       = lv_cmd
          TABLES
            data          = result
          EXCEPTIONS
            command_error = 1
            tcpip_error   = 2.
        IF sy-subrc = 1.
          return-type = 'E' .
          return-message = 'Command Error Occured during open of FTP Folder'.
          APPEND return.
        ELSEIF sy-subrc = 2.
          return-type = 'E' .
          return-message = 'TCIP Error Occured during open of FTP Folder'.
          APPEND return.
        ELSE.
          REFRESH t_blob.
          lv_blob_length = 992.
          TRANSLATE i_filename TO LOWER CASE.
          CALL FUNCTION 'FTP_SERVER_TO_R3'
            EXPORTING
              handle      = lv_ftp_handle
              fname       = i_filename         
            IMPORTING
              blob_length = lv_blob_length
            TABLES
              blob        = lt_dummy.
          t_blob[] = lt_dummy[].
        ENDIF.
      ENDIF.
    ENDFUNCTION.
    Regards
    Sajid
    Edited by: shaik sajid on Nov 16, 2010 7:25 AM

  • How to convert xml file into internal table in ABAP Mapping.

    Hi All,
    I am trying with ABAP mapping. I have one scenario in which I'm using below xml file as a sender from my FTP server.
    <?xml version="1.0" encoding="UTF-8" ?>
    - <ns0:MTO_ABAP_MAPPING xmlns:ns0="http://Capgemini/Mumbai/sarsingh">
      <BookingCode>2KY34R</BookingCode>
    - <Passenger>
      <Name>SARVESH</Name>
      <Address>THANE</Address>
      </Passenger>
    - <Passenger>
      <Name>RAJESH</Name>
      <Address>POWAI</Address>
      </Passenger>
    - <Passenger>
      <Name>CARRON</Name>
      <Address>JUHU</Address>
      </Passenger>
    - <Flight>
      <Date>03/03/07</Date>
      <AirlineID>UA</AirlineID>
      <FlightNumber>125</FlightNumber>
      <From>LAS</From>
      <To>SFO</To>
      </Flight>
      </ns0:MTO_ABAP_MAPPING>
    AT the receiver side I wnat to concatenate the NAME & ADDRESS.
    I tried Robert Eijpe's weblog (/people/r.eijpe/blog/2005/11/21/xml-dom-processing-in-abap-part-ii--convert-an-xml-file-into-an-abap-table-using-sap-dom-approach)
    but couldnt succeed to convert the xml file into internal table perfectly.
    Can anybody help on this. 
    Thanks in advance!!
    Sarvesh

    Hi Sarvesh,
    The pdf has details of ABAP mapping. The example given almost matches the xml file you want to be converted.
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/xi/3.0/how to use abap-mapping in xi 3.0.pdf
    Just in case you have not seen this
    regards
    Vijaya

  • How to get data of tabulated text file into internal table

    hi all,
    i want to get data from tabulated text file(notepad) into internal table. i searched in SCN and got lot of post regarding  how to convert excel file into internal table but i didnt get posts regarding text file.
    thanks
    SAchin

    try:
    DATA: BEGIN OF tabulator,
            x(1) TYPE x VALUE '09',
          END OF tabulator.
      READ DATASET file INTO wa.
    split wa at tabulator into table itab.
    A.

  • How to store output of SQ01 into internal table.

    Hello Experts
    How to store output of SQ01 into internal table.
    Thanks,
    Umesh

    You can't store the sq01 output into internal table.
    Once you create the query it will generate the abap program, in that program you can see the contents.
    Regards
    Sasi

  • How to transfer data of RFC into Internal Table inside a WD4A program?

    Hi Experts,
    I have created WD4A program. This program calls RFC. The output of RFC has to populate  a UI table. THe different cells of the table should have different color based on data.
    I have gone through following link:
    http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/707fb792-c181-2d10-61bd-ce15d58b5cf1
    The above link fetches data from directly from table. Then it passes the data into internal table.
    If I am using RFC, then how I can insert data of RFC into a internal table in WD4A program (se80 In drop down Web Dynpro Comp / Intf)
    My motto is to have table ouput whose different cells should have different color based on data.
    Please help.
    Regards,
    Gary
    Edited by: Jason Lax on Dec 28, 2011 2:52 PM (Fixed broken link)

    Hi Experts,
    I have resolved the issue. I have created WD4A program. This WD4A program calls the RFC.
    The RFC has a structure as export parameters called 'RESULT_FINAL'. I have altered the associated type of this table export parameter. I added Component 'Color' of component type 'WDUI_TABLE_CELL_DESIGN'.
    In the RFC I have added some code. The code is as below:
    loop  at it_t1.
          select pernr from pa0000 into table it_t2 where  pernr = it_t1-pernr  and stat2 ='3'
          and begda <= sy-datum AND endda >= sy-datum.
          if sy-subrc = 0.
            result_final-org_unit = result_objec-objid.
            result_final-pernr = it_t1-pernr.
            result_final-name = it_t1-name.
            result_final-color = '02'.       append result_final.
          endif.
        endloop.
    The line   result_final-color = '02'.   
    code returns Color.
    In the WD4A program, I have changed the Cell Design property of selected table coloumn to Color.
    This resolved the issue.
    Thanks every one for the reply.
    I have added above information for other SDN users.
    I am closing this thread,
    Regards,
    Gary

  • How to join THREE different tables into internal table using one select statement .

    How to join THREE different tables into internal table using one select statement .
    Hi experts,
    I would like to request your guidance in solving the problem of joining the data from three different database tables into one internal table
    Scenario:
    Database tables:
    SPFLI
    SFLIGHT
    SBOOK.
    Table Fields:
    SPFLI - CARRID CONNID COUNTRYFR CITYFRM COUNTRYTO CITYTO
    SFLIGHT - CARRID CONNID FLDATE SEATSMAX SEATSOCC SEATSMAX_C
    SEATSOCC_C SEATSMAX_F SEATSOCC_F
    SBOOK - CARRID CONNID CLASS
    MY INTERNAL TABLE IS IT_XX.
    Your help much appreciated.
    Thanks in advance.
    Pawan.

    Hi Pawan,
    please check below codes. hope it can help you.
    TYPES: BEGIN OF ty_xx,
            carrid     TYPE spfli-carrid   ,
            connid     TYPE spfli-connid   ,
            countryfr  TYPE spfli-countryfr,
            cityfrom   TYPE spfli-cityfrom  ,
            countryto  TYPE spfli-countryto,
            cityto     TYPE spfli-cityto   ,
            fldate     TYPE sflight-fldate ,
            seatsmax   TYPE sflight-seatsmax ,
            seatsocc   TYPE sflight-seatsocc ,
            seatsmax_b TYPE sflight-seatsmax_b,
            seatsocc_b TYPE sflight-seatsocc_b,
            seatsmax_f TYPE sflight-seatsmax_f,
            seatsocc_f TYPE sflight-seatsocc_f,
            class      TYPE sbook-class,
          END OF ty_xx,
          t_xx TYPE STANDARD TABLE OF ty_xx.
    DATA: it_xx TYPE t_xx.
    SELECT spfli~carrid
           spfli~connid
           spfli~countryfr
           spfli~cityfrom
           spfli~countryto
           spfli~cityto
           sflight~fldate
           sflight~seatsmax
           sflight~seatsocc
           sflight~seatsmax_b
           sflight~seatsocc_b
           sflight~seatsmax_f
           sflight~seatsocc_f
           sbook~class
      INTO TABLE it_xx
      FROM spfli INNER JOIN sflight
      ON spfli~carrid = sflight~carrid
      AND spfli~connid = sflight~connid
      INNER JOIN sbook
      ON spfli~carrid = sbook~carrid
      AND spfli~connid = sbook~connid.
    Thanks,
    Yawa

  • How to upload the flat file records into internal table by position?

    Hi
    I have a flat file which has 7 records in each row and they are NOT provided with CSV or Tab demilited...
    They are continous text without spaces....
    but i know the fixed length of each field Eg : 1st field 7 char and seconc field 3 char and so on...
    How can i upload this file into internal table by reading positions of each field...I know we can use GUI_UPLOAD and Read dataset and Open dataset...
    But please let me know to read the file with the fixed postions and load into internal table...
    Thanks in advance
    MM

    Hi
    As per my knowledge i dont think thr is some function module or so to read with a fixed positions.
    You can use the below method if you think this is the best way.
    Suppose your file has
    types : begin of ty_itab,
                field1 type char7,
                field2 type char3,
                field3 type chat3,
                field4 type char3,
                end of ty_itab.
    types : begin of ty_upload,
                 str type string,
                end of ty_upload.
    data : it_itab type standatd table of ty_itab,
              it_upload type standard table ot ty_upload,
              wa_itab type ty_itab,
              wa_upload type ty_upload.
    use gui_upload.get the data in it_upload.
    here you know that u have first 16 charcters makes a first row n then next 16 charcters next row
      Loop at it_upload into wa_upload.
       v_len =  strlen ( wa_upload ).
       v_len = v_len / 16.
        You get number of rows per record ,if it is decimal value make it final value if 3.9 make to 4.
        do v_len times.
          wa_itab = wa_upload.
          By this only first 16 characters are moved and respective fields will get a value.or else u can use offset
           wa_upload+0(16).
          append wa_itab to it_itab.
          Now shift 16 characters using shift command in wa_upload.
        enddo.
      endloop.
    Hope this syntax help you to resolve your issue.May be something i have missed .Right now i don't have sap system to send you the full correct syntax code.
    Cheers
    Joginder

  • How to load text data into internal table

    I have a text file to load txt data into internal table. So how to read text data with validation and to load all text data into the internal table?
    Say this is the text file:
    IO_NAME, IO_TYPE, IO_SHTXT, IO_LONGTEXT, DATATYPE, DATA LENGTH
    ZIO_TEST1, CHA,      IO TEST1,      IO TEST 1,        CHAR,         20
    ZIO_TEST2, CHA,      IO TEST2,      IO TEST 2,        CHAR,         20
    Regards,
    Mau

    Hi,
    U can use GUI_UPLOAD for this...
    Declare an internal table like
    data: begin of itab occurs 0,
    string(1200),
    end of itab.
    check the sample code:
    cange as you need
    DATA: DATEI_PC TYPE STRING VALUE 'C:\MATNR.TXT'.
    DATA: BEGIN OF ITAB occurs 0,
    TXT(1024),
    END OF ITAB.
    CALL METHOD CL_GUI_FRONTEND_SERVICES=>GUI_UPLOAD
    EXPORTING
    FILENAME = DATEI_PC
    FILETYPE = 'ASC'
    CHANGING
    DATA_TAB = ITAB[]
    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
    NOT_SUPPORTED_BY_GUI = 17
    ERROR_NO_GUI = 18
    OTHERS = 19.
    IF SY-SUBRC NE 0. WRITE: / 'Error in Uploading'. STOP. ENDIF.
    WRITE: / 'UPLOAD:'.
    LOOP AT ITAB. WRITE: / ITAB-TXT. ENDLOOP.

  • How to get editable data into internal table

    Hi ABAPers,
    I am displaying REUSE_ALV_GRID_DISPLAY report with one editable field and i have post button in report. Once i select post button i need to get editable data to internal table which i passed to REUSE_ALV_GRID_DISPLAY.
    actually i am writing below code but data is not coming to internal table.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
         i_callback_program                          =  sy-repid
         i_callback_pf_status_set                  = 'PF-STATUS'
         i_callback_user_command               = 'USER_COMMAND '
         it_fieldcat                                        = t_field[]
         i_default                                          = 'X'
        TABLES
          t_outtab                          =   <fs_display1>.       "t_display
    FORM user_command USING g_ucomm LIKE sy-ucomm
                   rs_selfield TYPE slis_selfield.
      g_test1 = g_ucomm.
      CASE g_ucomm.
        WHEN 'POST'.
          READ TABLE <fs_display1> ASSIGNING <fsw_display1> INDEX 1.    "Just for testing index 1
          IF sy-subrc = 0.
            w_display = <fsw_display1>.
            APPEND w_display TO t_display.
            CLEAR : w_display.
          ENDIF.
          PERFORM v1.
          PERFORM bapi_call.
      ENDCASE.
    ENDFORM.                    "USER_COMMAND
    Please help me how to get.
    Regards,
    Raju.

    Hi,
    Try the following:
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    i_callback_program = sy-repid
    i_callback_pf_status_set = 'PF-STATUS'
    i_callback_user_command = 'USER_COMMAND '
    it_fieldcat = t_field[]
    i_default = 'X'
    TABLES
    t_outtab = <fs_display1>. "t_display
    FORM user_command USING g_ucomm LIKE sy-ucomm
    rs_selfield TYPE slis_selfield.
    g_test1 = g_ucomm.
    CASE g_ucomm.
    WHEN 'POST'.
    * to reflect the data changed into internal table
          DATA : ref_grid TYPE REF TO cl_gui_alv_grid. "new
          IF ref_grid IS INITIAL.
            CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
              IMPORTING
                e_grid = ref_grid.
          ENDIF.
          IF NOT ref_grid IS INITIAL.
            CALL METHOD ref_grid->check_changed_data.
          ENDIF.
    READ TABLE <fs_display1> ASSIGNING <fsw_display1> INDEX 1. "Just for testing index 1
    IF sy-subrc = 0.
    w_display = <fsw_display1>.
    APPEND w_display TO t_display.
    CLEAR : w_display.
    ENDIF.
    PERFORM v1.
    PERFORM bapi_call.
    ENDCASE.
    ENDFORM. "USER_COMMAND
    Hope it helps.
    Regards,
    Gilberto Li

Maybe you are looking for

  • Issue with "firstRecord" Business Component method of JAVA Data bean API.

    Hi, Following is my use-case scenario: I have to add or associate child MVG business component (CUT_Address) with the parent business component (Account) using JAVA Data bean API. My requirement is: first to check whether child business component(i.e

  • Renaming Set Code and Stage Code for a refresh set in Concurrent Manager

    Hi, We're using Oracle Applications 11.5.10.2 on a 10.2.0.4 Database: Would anyone know how to rename the Set Code for the Refresh Set and Stage Code for the Stage for a Refresh Set in Concurrent Manager? I've seen it done in the two Report Sets but

  • Select Query: Part of the field

    Hello Experts, I have an issue. In my selection from one table T1, i need to select just lines that have the field F1 begins by some numbers. For example, all lines that have the field F1 like that '12345678xxxxx'.  The problem is: in my selection i

  • How can I calibrate the colors in my 3g iphone

    I noticed that when I watch the videos in my iphone 3g the colors are saturaded, who knows how to calibrate the colors?

  • No Audio On YouTube Videos

    So, I got the problem I had fixed and now when I go to YouTube to watch a video the video plays, but there's no audio.