Msgid returned be OCIAQEnq()

I was trying to get the msgid returned in OCIAQEnq():
OCIRaw * msgid;
OCIAQEnq(,,,,,(OCIRaw**) &msgid, 0);
The msg was enqueued but I don't get the correct msgid.
I can tell this by issuing a follow up query on the queue table with the same variable msgid as query criteria.
Any idea how to resolve this?
Thx in advance.

I had not noticed that effect on Open Library, I have 'returned' books early and they then became available for others to check out but I never tried to re-download inside the loan period.  Re not using Windows: I expect there will still be an equivalent folder to "My Digital Editions" into which ADE saves each epub.  It still might be worth searching for the book and deleting it from that folder then trying to re-download the book.

Similar Messages

  • Notification using OO4O returns a msgid with ?????

    I used the notifyme oo4o method and successfully receive a notification whenever a message is enqueued to the database queue (in both VB And C++).
    However the msgid returned in the notify me method has a value of ?????.
    I need to pass the message id to another application. How can i find out the actual value of the message id?
    Any help will be appreciated as this is an urgent requirement.
    Thanks-
    AS

    Up until a certain version of the OCI (and I forget exactly which version, see below) if you called the OCI initialization routines multiple times, only the first one was used.
    I am pretty sure that this was fixed in one of the 8.1.7 patch releases, but I know it is fixed by 9i. The only problem still seems to be that you can only get more restrictive, not less. In this case you should be OK.

  • Error  Purchase order item 00010 still contains faulty schedule lines

    Hi All,
    when reprocessing an inbound IDOC for PO i am getting these errors
    1) Purchase order item 00010 still contains faulty schedule lines  and
    2) No instance of object type PurchaseOrder has been created. External refer.
    This error is getting during inbound processing and the status sets to 51.
    please help me in solving this
    Thanks,
    Hari kishore

    That ID in Return table is the Message Class of the message you get in return line (check in transaction SE91).
    You can build the text as this:
      CALL FUNCTION 'MESSAGE_TEXT_BUILD'
           EXPORTING
                msgid               = return-id
                msgnr               = return-number
                msgv1               = return-message_v1
                msgv2               = return-message_v2
                msgv3               = return-message_v3
                msgv4               = return-message_v4
           IMPORTING
                message_text_output = built_msg_text
           EXCEPTIONS
                OTHERS              = 1.
    As for the message itself, i don't know what it may be.
    Read Schedule lines parameter documentation in SE37, maybe there you have a clue.
    Regards
    Please reward points if helpful

  • AQ on RAC: Callback does not dequeue (sometimes)

    Hi,
    We've got the following problem on 11.2.0.3:
    RAC consists of 2 instances.
    The Queue Table is defined with primary instance set to 1.
    On instance 1 parameter job_queue_processes is set to 10 - on instance 2 it is set to 0!
    Queues defined on this Queue Table are dequeued via callback functions.
    Normally every incoming messages should be dequeued automatically by the defined callback functions. But in our setup this does not seem to work: messages are regularly hanging with status READY and need a manual dequeue.
    What's wrong with this setup? Why does this not work?
    Thanks for any input,
    Stephan

    Hi,
    You need to check if there is any inconsistency.
    select count(*) from sys.aq_srvntfn_table n where n.user_data.msg_id in
    (select n.user_data.msg_id msgid from sys.aq_srvntfn_table n minus select msgid from APP_SCHEMANAME.APP_QUEUE_TABLENAME)
    and n.user_data.queue_name = '"APP_SCHEMANAME"."APP_QUEUENAME"';
    Note : in 10.1 onwards, where the schema and queue name can be mixed case, that the query to identify the mismatch needs to reference the n.user_data.queue_name correctly by enclosing the APP_SCHEMANAME and APP_QUEUENAME in double quotes
    If above returns any row:
    ACTION PLAN:
    This shows messages are in the notification queue but not in the user-created application queue.
    For those msgids returned, manually dequeue these messages by specifying the message id from the notification queue : AQ_SRVNTFN_TABLE_Q (in versions below 11.2) or AQ_SRVNTFN_TABLE_Q_<N> (in versions starting 11.2). In doing this, we are removing the message in the notification queue which is not in the Application queue. This should allow the notification activity to move on. e.g.
    set serveroutput on
    declare
    enqueue_options dbms_aq.enqueue_options_t;
    message_properties dbms_aq.message_properties_t;
    dequeue_options dbms_aq.dequeue_options_t;
    message_handle raw(16);
    mes aq$_srvntfn_message;
    begin
      dequeue_options.wait := dbms_aq.no_wait;
      dequeue_options.consumer_name := '<consumer_name>'
      dequeue_options.msgid := '<msg id>';    -- <<< supply mesage id
      dbms_aq.dequeue(queue_name => 'AQ_SRVNTFN_TABLE_Q',   -- <<< as appropriate
      dequeue_options => dequeue_options,
      message_properties => message_properties,
      payload => mes,
      msgid => message_handle);
      dbms_output.put_line('removed: ' || message_handle);
      commit;
    end;
    It may be required to kill off the register driver jobs to restart the mechanism correctly after the queues have been reconciled and the above query returns 0 rows indicating queues are consistent. It  is also recommended to restart the database after this process has been completed before enqueueing further messages into the user-created application queue.
    Note : you may need to specify a consumer_name in the above if the related queue is a multi consumer queue
    Thanks,
    Reena

  • F4IF_INT_TABLE_VALUE_REQUEST - how can I return all values from the line?

    Hi,
    I'm using FM F4IF_INT_TABLE_VALUE_REQUEST to show a pop-up with my internal table values.  The internal table has 3 fields, ATINN, ATZHL and a description field ATWTB.  ATINN and ATZHL are needed to complete the unique table key, however this FM will only return the value of one field in any line I select.
    How can I see all the values in the line I select in the return table?
    My code is as follows:
      DATA: tbl_cawnt LIKE cawnt OCCURS 0,
            wa_cawnt LIKE cawnt,
            BEGIN OF tbl_list OCCURS 0,
              atinn LIKE cawnt-atinn,
              atzhl LIKE cawnt-atzhl,
              atwtb LIKE cawnt-atwtb,
            END OF tbl_list,
            wa_list LIKE tbl_list,
            tbl_return LIKE ddshretval OCCURS 0,
            wa_return LIKE ddshretval,
            tbl_fields LIKE dfies OCCURS 0,
            tbl_dynp LIKE dselc OCCURS 0.
      REFRESH: tbl_list, tbl_cawnt.
      SELECT atinn atzhl atwtb
        FROM cawnt
        INTO CORRESPONDING FIELDS OF TABLE tbl_cawnt
        WHERE spras EQ sy-langu.
      LOOP AT tbl_cawnt INTO wa_cawnt.
        CLEAR wa_list.
        MOVE: wa_cawnt-atwtb TO wa_list-atwtb,
              wa_cawnt-atinn TO wa_list-atinn,
              wa_cawnt-atzhl TO wa_list-atzhl.
        APPEND wa_list TO tbl_list.
      ENDLOOP.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          retfield        = 'ATWTB'
          dynpprog        = sy-repid
          dynpnr          = sy-dynnr
          value_org       = 'S'
        TABLES
          value_tab       = tbl_list
          return_tab      = tbl_return
        EXCEPTIONS
          parameter_error = 1
          no_values_found = 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.
    Thanks!

    Hi,
      Use the structure DYNPFLD_MAPPING
    With this internal table you can easily define that you want to return
    other columns of the hit list in addition to field RETFIELD to the
    screen.
    In this IT you can MAP the screen fields to the serch help screen fields this has three fields
    FLDNAME this is the field anme from the search help
    FLDINH This has to be blank which would be field with the field value that you want to map
    DYFLDNAME THis is the screen field name.
    So here you can get the values for the other fields that you want which are on the search help just populate the name of the fields in FLDNAME.
    Regards,
    Himanshu

  • F4IF_INT_TABLE_VALUE_REQUEST not returning value with 2 decimals point

    hi all,
    i use function F4IF_INT_TABLE_VALUE_REQUEST to do search help, the master data in table ZINVEST has field ZNO, with field type CURR , 2 decimals point.
    the return table shows 2 decimals point but in display screen it only shows 1 decimal point, pls advice
    here's the coding:
    DATA : BEGIN OF itab OCCURS 0,
              e_value(20),
             END OF itab.
      DATA: BEGIN OF field_tab OCCURS 0.
              INCLUDE STRUCTURE dfies.
      DATA END OF field_tab.
      DATA : return_tab LIKE ddshretval OCCURS 0 .
          CLEAR field_tab.
          field_tab-fieldname = 'E_VALUE'.
          field_tab-intlen = 17.
          field_tab-outputlen = 17.
          field_tab-decimals = 2.
          field_tab-inttype = 'C'.
          field_tab-scrtext_m = 'Investment No'.
          APPEND field_tab.
          SELECT * FROM ZINVEST.
            CLEAR: itab.
            itab-e_value = ZINVEST-ZNO.
            APPEND itab.
          ENDSELECT.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          retfield        = 'E_VALUE'
          dynprofield     = 'A'
          dynpprog        = sy-cprog
          dynpnr          = sy-dynnr
        TABLES
          value_tab       = itab
          field_tab       = field_tab
          return_tab      = return_tab
        EXCEPTIONS
          parameter_error = 1
          no_values_found = 2
          OTHERS          = 3.

    Hi ester,
    You shud try this way. Try to use this code.
    DATA:  BEGIN OF it_help OCCURS 0,
           zuonr TYPE zvinvoice,
           kunnr TYPE kunnr,
           name  TYPE zvcustname,
           END OF it_help.
    SELECT-OPTIONS: p_zuonr FOR bsid-zuonr.
    SELECT DISTINCT
             zuonr
             kunnr
      INTO CORRESPONDING FIELDS OF TABLE it_help
      FROM bsid
      WHERE zuonr <> space.
      SORT it_help BY zuonr kunnr.
      DELETE ADJACENT DUPLICATES FROM it_help
      COMPARING zuonr kunnr.
      IF it_help[] IS NOT INITIAL.
        SELECT kunnr
               name1
               name2
        INTO TABLE it_kna1
        FROM kna1
        FOR ALL ENTRIES IN it_help
        WHERE kunnr = it_help-kunnr.
        SORT it_kna1 BY kunnr.
        CLEAR v_tabix.
        SORT it_help BY kunnr.
        LOOP AT it_help.
          v_tabix = sy-tabix.
          READ TABLE it_kna1 WITH KEY kunnr = it_help-kunnr
                                      BINARY SEARCH.
          IF sy-subrc EQ 0.
            CONCATENATE it_kna1-name1 it_kna1-name2 INTO it_help-name  
            SEPARATED BY space.
            MODIFY it_help FROM it_help INDEX v_tabix
                                        TRANSPORTING name.
          ENDIF.
        ENDLOOP.
    FORM event_selscr_valreq_for_pzuonr .
    ***Function module to display the search help for the assignment filed****
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          retfield         = 'ZUONR'
          dynpprog         = sy-cprog
          dynpnr           = sy-dynnr
          dynprofield      = 'P_ZUONR'
          window_title     = text-029
          value_org        = 'S'
          callback_program = sy-repid
        TABLES
          value_tab        = it_help
        EXCEPTIONS
          parameter_error  = 1
          no_values_found  = 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.
    Reward if help ful.
    Regards
    Azad.

  • F4IF_INT_TABLE_VALUE_REQUEST - return more than 1 field in return_values?

    In a dialog program I"m using the 'on value request' to call a routine that builds a dropdown on a field.  It looks like this:
    PROCESS ON VALUE-REQUEST.
      FIELD ekpo_ci-zzlicnum module build_search.
    Within build_search, I build itab_values with the dropdown values and the function module is called:
    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
         EXPORTING RETFIELD = 'ZZLICNUM'
                   DYNPPROG = w_progname
                   DYNPNR = w_scr_num
                   DYNPROFIELD = 'ZZLICNUM'
                   VALUE_ORG = 'S'
         TABLES
                   VALUE_TAB = ITAB_VALUES
                   RETURN_TAB = RETURN_VALUES
         EXCEPTIONS
                   PARAMETER_ERROR = 1
                   NO_VALUES_FOUND = 2
                   OTHERS = 3.
    The routine calls F4IF_INT_TABLE_VALUE_REQUEST and in the dropdown, 5 fields are shown in each row (built in an internal table itab_values).  When I select one of the rows, it returns the field value for zzlicnum in return_values.  Is there a way to also return the other values I have in itab_values (other than just zzlicnum) - I need to use the other fields that are associated with zzlicnum in my program for some additional logic.
    I appreciate any help!

    hi,
           refer to these codes:
           you can change something according to your requirement.
    PARAMETERS:
      a TYPE char10,
      b TYPE char10,
      c TYPE char10.
    DATA:
      BEGIN OF tab OCCURS 0,
        field1 TYPE char10,
        field2 TYPE char10,
        field3 TYPE char10,
      END OF tab,
      wa LIKE LINE OF tab,
      DYNPFLD_MAPPING TYPE STANDARD TABLE OF DSELC,
      dyn_wa TYPE DSELC,
      lt_return TYPE TABLE OF DDSHRETVAL,
      lwa_return TYPE ddshretval.
    INITIALIZATION.
      wa-field1 = 'aaaaa'.
      wa-field2 = 'bbbbb'.
      wa-field3 = 'ccccc'.
      APPEND wa to tab.
      wa-field1 = 'aaaaa'.
      wa-field2 = 'bbccc'.
      wa-field3 = 'ddddd'.
      APPEND wa to tab.
      wa-field1 = 'aaaab'.
      wa-field2 = 'bbccc'.
      wa-field3 = 'eeeee'.
      APPEND wa to tab.
      dyn_wa-FLDNAME = 'FIELD1'.
      dyn_wa-DYFLDNAME = 'A'.
      APPEND dyn_wa to DYNPFLD_MAPPING.
      dyn_wa-FLDNAME = 'FIELD2'.
      dyn_wa-DYFLDNAME = 'B'.
      APPEND dyn_wa to DYNPFLD_MAPPING.
      dyn_wa-FLDNAME = 'FIELD3'.
      dyn_wa-DYFLDNAME = 'C'.
      APPEND dyn_wa to DYNPFLD_MAPPING.
    AT SELECTION-SCREEN on VALUE-REQUEST FOR a.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
    *     DDIC_STRUCTURE         = ' '
          retfield               = 'FIELD1'
    *     PVALKEY                = ' '
          DYNPPROG               = sy-cprog
          DYNPNR                 = '1000'
          DYNPROFIELD            = 'A'
    *     STEPL                  = 0
    *     WINDOW_TITLE           = WINDOW_TITLE
    *     VALUE                  = ' '
          VALUE_ORG              = 'S'
    *     MULTIPLE_CHOICE        = ' '
    *     DISPLAY                = ' '
         CALLBACK_PROGRAM       = sy-cprog
         CALLBACK_FORM          = 'CALLBACK_F4'
    *     MARK_TAB               = MARK_TAB
    *   IMPORTING
    *     USER_RESET             = USER_RESET
        TABLES
          value_tab              = tab
    *     FIELD_TAB              = FIELD_TAB
          RETURN_TAB             = lt_return
    *      DYNPFLD_MAPPING        = DYNPFLD_MAPPING
    *   EXCEPTIONS
    *     PARAMETER_ERROR        = 1
    *     NO_VALUES_FOUND        = 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.
    form callback_f4 TABLES record_tab STRUCTURE seahlpres
                CHANGING shlp TYPE shlp_descr
                         callcontrol LIKE ddshf4ctrl.
      DATA:
        ls_intf     LIKE LINE OF shlp-interface,
      ls_prop     LIKE LINE OF shlp-fieldprop.
    *Hide unwanted fields
      CLEAR: ls_prop-shlpselpos,
             ls_prop-shlplispos.
    *  MODIFY shlp-fieldprop FROM ls_prop
    *    TRANSPORTING shlpselpos shlplispos
    *  WHERE ( fieldname NE 'F0001'  AND
    *          fieldname NE 'F0002'  AND
    *          fieldname NE 'F0003' ).
    *  " Overwrite selectable fields on search help
      REFRESH: shlp-interface.
      ls_intf-shlpfield = 'F0001'.
      ls_intf-valfield  = 'A'.
      ls_intf-f4field   = 'X'.
      APPEND ls_intf TO shlp-interface.
      ls_intf-shlpfield = 'F0002'.
      ls_intf-valfield  = 'B'.
      ls_intf-f4field   = 'X'.
      APPEND ls_intf TO shlp-interface.
      ls_intf-shlpfield = 'F0003'.
      ls_intf-valfield  = 'C'.
      ls_intf-f4field   = 'X'.
      APPEND ls_intf TO shlp-interface.
    ENDFORM.

  • How to call an alv report from another program and return back

         Hello ,
    I am calling one abap program (Prgm B) from another program (Prgrm A).
    Here, Prgm B is an ALV report. I have fetch some data from Prgem B that gets stored in an internal table.
    Now, I am using below code in Prgrm A,
      SUBMIT Prgrm B VIA SELECTION-SCREEN
                          WITH SELECTION-TABLE rspar
                          EXPORTING LIST TO MEMORY
                          AND RETURN.
    When Prgrm A executed, it lead me to selection screen of Prgrm B and when I click F8, it shows me the report output, In short, it doesnt return back to Prgrm A. It ends up showing me the alv report if Prgrm B even afetr using RETURN statement.
    I want to get back to Prgrm A by fetching some data from Prgrm B.
    Please let me know, if i am missing something.
    Regards,
    Seema

    Hi Seema,
    Refer below code.
    DATA: v_matnr LIKE mara-matnr.
    DATA: t_listobject TYPE abaplist OCCURS 0 WITH HEADER LINE.
    DATA: t_mara TYPE mara OCCURS 0 WITH HEADER LINE.
    DATA: BEGIN OF t_ascilist OCCURS 0,
             line(200).
    DATA: END OF t_ascilist.
    data var(3) type c.
    SELECT-OPTIONS: s_matnr FOR v_matnr.
    var = '  3'.
    START-OF-SELECTION.
       SUBMIT ztestaks1 WITH s_matnr IN s_matnr EXPORTING LIST TO MEMORY
       AND RETURN.
       CALL FUNCTION 'LIST_FROM_MEMORY'
            TABLES
                 listobject = t_listobject
            EXCEPTIONS
                 not_found  = 1
                 OTHERS     = 2.
       IF sy-subrc <> 0.
         MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                 WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
       ELSE.
         CALL FUNCTION 'LIST_TO_ASCI'
    *     EXPORTING
    *       LIST_INDEX               = -1
    *       WITH_LINE_BREAK          = ' '
           TABLES
             listasci                 = t_ascilist
             listobject               = t_listobject
           EXCEPTIONS
             empty_list               = 1
             list_index_invalid       = 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.
         ELSE.
           WRITE:/ 'Below are the lines from the submitted program.'.
           LOOP AT t_ascilist.
             WRITE:/ t_ascilist-line.
           ENDLOOP.
           SKIP 2.
         ENDIF.
       ENDIF.
       IMPORT t_mara FROM MEMORY ID 'T_MARA'.
       WRITE:/
    'Here is the output from the table exported from the submitted program.'
       LOOP AT t_mara.
         WRITE:/ t_mara-matnr.
       ENDLOOP.
    Submitted program
    REPORT  ZTESTAKS1.
    DATA: v_matnr LIKE mara-matnr,
           v_maktx LIKE makt-maktx.
    DATA: t_mara TYPE mara OCCURS 0 WITH HEADER LINE.
    DATA: BEGIN OF t_makt OCCURS 0,
             matnr LIKE makt-matnr.
    DATA: END OF t_makt.
    SELECT-OPTIONS: s_matnr FOR v_matnr,
                     s_maktx FOR v_maktx.
    START-OF-SELECTION.
       SELECT matnr INTO TABLE t_makt
                    FROM makt
                   WHERE matnr IN s_matnr
                     AND maktx IN s_maktx.
    if not t_makt[] is initial.
       SELECT * FROM mara
                INTO TABLE t_mara FOR ALL ENTRIES IN t_makt
               WHERE matnr = t_makt-matnr.
    endif.
       EXPORT t_mara TO MEMORY ID 'T_MARA'.
       WRITE:/ 'This list is from the submitted program'.
       SKIP 1.
       LOOP AT t_mara.
         WRITE:/ t_mara-mtart.
       ENDLOOP.
    Hopes this helps you.
    Thanks,
    Ashok.

  • How can we know the return code of BDC Program ?

    Hi All,
    Please tell me : How can we know the return code of BDC Program when being exceuted in Session or in Transaction mode.
    In my program, we are uploading data from Excel sheet to SAP via BDC
    The records that are not updated we want to create a log file.
    Now to know whether a record is updated ot not, wat syst field shloud be used?
    Its urgent....
    <b>Reward Point will be there ....</b>
    Thanks,
    Harish

    Hi harish,
    try the logic in this code ...
    i had attached input file in the end.
    TYPES: begin of errmess,
            msgnr type t100-msgnr,
            text type t100-text,
           end of errmess.
    TABLES : t100.
    DATA: BEGIN OF DD_VA01,
           AUART TYPE VBAK-AUART,
           KUNNR TYPE RV45A-KUNNR,
           BSTKD TYPE VBKD-BSTKD,
           MABNR TYPE RV45A-MABNR,
           KWMENG(2) type C,
           KBETR(2) type C,
          END OF DD_VA01.
    DATA:IT_VA01     Like TABLE OF DD_VA01,
         WA_VA01     Like LINE  OF IT_VA01,
         WA_VA01_F   Like LINE  OF IT_VA01,
         IT_BDCDATA  TYPE TABLE OF BDCDATA,
         WA_BDCDATA  Like Line  OF IT_BDCDATA,
         W_FNAME     TYPE STRING,
         messtab like bdcmsgcoll occurs 0 with header line,
         it_errmess type table of errmess,
         wa_errmess like line of it_errmess,
         err_message type string.
    data: zf1 type i,
          zc1 type c value '2',
          fn(20) type c.
    Main Code ************************************************************
    PERFORM get_input using 'C:\Documents and Settings\ic881592\Desktop\Daran_bdc_VA01-e.txt'.
    SORT IT_VA01 BY AUART KUNNR BSTKD.
    LOOP AT IT_VA01 INTO WA_VA01.
      if WA_VA01_F-AUART <> WA_VA01-AUART OR
         WA_VA01_F-KUNNR <> WA_VA01-KUNNR OR
         WA_VA01_F-BSTKD <> WA_VA01-BSTKD.
           PERFORM set_header_flag.
           PERFORM create_bdc_header_data.
      endif.
      PERFORM create_bdc_item_data.
    ENDLOOP.
    PERFORM call_transaction.
    PERFORM errorlog.
    Procedures ***********************************************************
    form get_input using w_fname.
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          FILENAME            = W_FNAME
          HAS_FIELD_SEPARATOR = '#'
        TABLES
          DATA_TAB            = IT_VA01.
    endform.
    form call_transaction.
        PERFORM bdc_field       using 'BDC_OKCODE' '/11'.
        CALL TRANSACTION 'VA01' USING IT_BDCDATA MODE 'A' messages into messtab.
        refresh it_bdcdata.
    endform.
    FORM set_header_flag.
           WA_VA01_F-AUART = WA_VA01-AUART.
           WA_VA01_F-KUNNR = WA_VA01-KUNNR.
           WA_VA01_F-BSTKD = WA_VA01-BSTKD.
           if zf1 = 1.
               PERFORM call_transaction.
           endif.
           zf1 = 1.
    endform.   "set_header_flag.
    form create_bdc_header_data.
         perform bdc_dynpro      using 'SAPMV45A' '0101'.
         perform bdc_field       using 'VBAK-AUART' WA_VA01-AUART.
         perform bdc_field       using 'BDC_OKCODE' '/00'.
         perform bdc_dynpro      using 'SAPMV45A' '4001'.
         perform bdc_field       using 'KUAGV-KUNNR' WA_VA01-KUNNR.
         perform bdc_field       using 'VBKD-BSTKD' WA_VA01-BSTKD.
         perform bdc_field       using 'BDC_OKCODE' '/00'.
         perform bdc_dynpro      using 'SAPMSSY0' '0120'.
         perform bdc_field       using 'BDC_CURSOR' '04/06'.
         perform bdc_field       using 'BDC_OKCODE' '=CHOO'.
         perform bdc_dynpro      using 'SAPMV45A' '4001'.
         PERFORM bdc_field       USING 'BDC_OKCODE' '=POAN'.
    endform. "create_bdcdata
    FORM create_bdc_item_data.
         CONCATENATE 'RV45A-KWMENG(' zc1 ')' INTO FN.
         perform bdc_field       using 'BDC_CURSOR' FN.
         perform bdc_field       using FN WA_VA01-KWMENG.
         CONCATENATE 'KOMV-KBETR(' zc1 ')' INTO FN.
         perform bdc_field       using FN WA_VA01-KBETR.
         CONCATENATE 'RV45A-MABNR(' zc1 ')' INTO FN.
         perform bdc_field       using FN WA_VA01-MABNR.
         perform bdc_dynpro      using 'SAPMV45A' '4001'.
         PERFORM bdc_field       USING 'BDC_OKCODE' '=POAN'.
    ENDFORM.
    form errorlog.
      LOOP AT MESSTAB .
        if MESSTAB-MSGNR = '311' or MESSTAB-MSGTYP = 'E'.
            SELECT SINGLE msgnr text FROM T100
                            into wa_errmess
                            WHERE SPRSL = MESSTAB-MSGSPRA
                              AND ARBGB = MESSTAB-MSGID
                              AND MSGNR = MESSTAB-MSGNR.
            IF SY-SUBRC = 0.
              err_message = wa_errmess-TEXT.
              IF err_message CS '&1'.
                REPLACE '&1' WITH MESSTAB-MSGV1 INTO err_message.
                REPLACE '&2' WITH MESSTAB-MSGV2 INTO err_message.
                REPLACE '&3' WITH MESSTAB-MSGV3 INTO err_message.
                REPLACE '&4' WITH MESSTAB-MSGV4 INTO err_message.
              ELSE.
                REPLACE '&' WITH MESSTAB-MSGV1 INTO err_message.
                REPLACE '&' WITH MESSTAB-MSGV2 INTO err_message.
                REPLACE '&' WITH MESSTAB-MSGV3 INTO err_message.
                REPLACE '&' WITH MESSTAB-MSGV4 INTO err_message.
              ENDIF.
              CONDENSE err_message.
              WRITE: / MESSTAB-MSGTYP, err_message .
            ELSE.
              WRITE: / MESSTAB.
            ENDIF.
        endif.
      ENDLOOP.
    endform. "errorlog
    FORM BDC_DYNPRO USING PROGRAM DYNPRO.
      WA_BDCDATA-PROGRAM  = PROGRAM.
      WA_BDCDATA-DYNPRO   = DYNPRO.
      WA_BDCDATA-DYNBEGIN = 'X'.
      APPEND WA_BDCDATA TO IT_BDCDATA.
      CLEAR  WA_BDCDATA.
    ENDFORM.
    FORM BDC_FIELD USING FNAM FVAL.
      WA_BDCDATA-FNAM = FNAM.
      WA_BDCDATA-FVAL = FVAL.
      APPEND WA_BDCDATA TO IT_BDCDATA.
      CLEAR  WA_BDCDATA.
    ENDFORM.
    input file :
    OR     2148     0001235     R-1162     8     17
    OR     2148     0001235     R-1161     2     30
    OR     2148     0001235     100-400     6     25
    OR     2148     0001235     R-1162     4     12
    OR     2148     0001236     R-1162     3     12
    OR     2148     0001236     R-1161     2     30
    OR     2148     0001236     100-400     1     25
    OR     2148     0001236     R-1162     7     12
    OR     2148     0001236     R-1161     8     30
    OR     2148     0001236     100-400     10     25
    OR     2148     0001235     R-1161     5     30
    OR     2148     0001235     100-400     2     25
    OR     2148     0001235     R-11621     3     12
    OR     2148     0001235     R-1161     2     30
    OR     2148     0001235     100-400     1     25
    OR     2148     0001235     R-1162     7     12
    OR     2148     0001235     R-1161     8     30
    OR     2148     0001235     100-400     10     25
    OR     2148     0001236     R-1162     8     17
    OR     2148     0001236     R-1161     2     30
    OR     2148     0001236     100-400     6     25
    OR     2148     0001236     R-1162     4     12
    OR     2148     0001236     R-1161     5     30
    OR     2148     0001236     100-400     2     25

  • Multiple return fields in 'F4IF_INT_TABLE_VALUE_REQUEST'

    I have used FM  'F4IF_INT_TABLE_VALUE_REQUEST'.
    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
          EXPORTING
          DDIC_STRUCTURE         = 'ZRETURN_GP '
            RETFIELD               = 'KOSTL'
          PVALKEY                = ' '
            DYNPPROG               = 'SY-CPROG '
           DYNPNR                 = '0009'
          DYNPROFIELD            = 'ZRETURN_GP-DEPT_CD'
          STEPL                  = 0
          WINDOW_TITLE           =
          VALUE                  = ' '
           VALUE_ORG              = 'S'
        MULTIPLE_CHOICE        = 'X'
          DISPLAY                = ' '
          CALLBACK_PROGRAM       = ' '
          CALLBACK_FORM          = ' '
          MARK_TAB               =
        IMPORTING
          USER_RESET             =
          TABLES
            VALUE_TAB              = I_DEPT
          FIELD_TAB              =
          RETURN_TAB             =
                                                DYNPFLD_MAPPING        =
         EXCEPTIONS
           PARAMETER_ERROR        = 1
           NO_VALUES_FOUND        = 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.
    i want to return another field if itab i_dept to screen field along with screen field 'ZRETURN_GP-DEPT_CD'.
    for this i have to use the importing parameter DYNPFLD_MAPPING        =.
    i dont know how to declare screen fields in front of this parameter.
    ifanybody know .plz suggest how to declare screen fileds and fields of itab.

    All the sales tables have VBELN as the primary key . But, if you notice closely, the data element for tables differ :
    For order ->table VBAK -> data element VBELN_VA
    For delivery -> table LIKP ->data element VBELN_VL
    Similarly check the data element for VBRK-VBELN. While declaring GT_VBELN, declare VBELN type VBELN_VF.  Description will come from the data element.

  • FM  'F4IF_INT_TABLE_VALUE_REQUEST'-return fields

    Here is my code:
    data :begin of i_dept occurs 0,
    kostl like cskt-kostl,
    LTEXT like cskt-LTEXT,
    end of i_dept.
    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
          EXPORTING
    *       DDIC_STRUCTURE         = 'ZRETURN_GP '
            RETFIELD               = 'KOSTL'
    *       PVALKEY                = ' '
            DYNPPROG               = 'SY-CPROG '
           DYNPNR                 = '0009'
          DYNPROFIELD            = 'ZRETURN_GP-GOING_TO_DEPT'
    *       STEPL                  = 0
    *       WINDOW_TITLE           =
    *       VALUE                  = ' '
           VALUE_ORG              = 'S'
    *     MULTIPLE_CHOICE        = 'X'
    *       DISPLAY                = ' '
    *       CALLBACK_PROGRAM       = ' '
    *       CALLBACK_FORM          = ' '
    *       MARK_TAB               =
    *     IMPORTING
    *       USER_RESET             =
          TABLES
            VALUE_TAB              = I_DEPT
    *       FIELD_TAB              =
    *       RETURN_TAB             =
    *       DYNPFLD_MAPPING        =
         EXCEPTIONS
           PARAMETER_ERROR        = 1
           NO_VALUES_FOUND        = 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.
    how to declare multiple return fields in this parameter of function module.????
           DYNPFLD_MAPPING        =
    i have used POV on a textfield. amd i m calling this function module in POV.
    what i want:
    when user click on kostl of i_dept( in the help displayed)..then along with field KOSTL....LTEXT field also returns in\
    screen field ZRETURN_GP-GOING_TO_DEPT_DESC.
    I Have read in the documentation of this function module that in parameter
          DYNPFLD_MAPPING        =
    we can declare multiple return fields.
    thats is what i want to know....how to declare multiple return fields.???
    suggest some methods.
    new concepts are also welcome.!

    If I understand correctly you want to populate more than one field from this request?  There are forum posts about this...finding my favorite eluded me today, so I'm including my little demo example.
    In the example below, the table field and the screen field have the same name...they could be different, as in P_carrid, etc.  YOu could also have data from different tables...you just need to get all the associated values into a single row in your internal table, which could be built based on DDIC or a type declaration, etc.....Adjust as needed:
    parameters : carrid type spfli-carrid,
                 connid type spfli-connid,
                 fldate type sflight-fldate.
    data : itab type table of sflight with header line.
    data : fmap type table of dselc with header line.
    at selection-screen on value-request for carrid." If it is a selection Screen
    *else in PROCESS ON VALUE REQUEST
      select * from sflight into table itab.
      sort itab by carrid connid fldate.
      delete adjacent duplicates from itab
      comparing carrid connid fldate.
      fmap-fldname = 'CARRID'.  "table field
      fmap-dyfldname = 'CARRID'. "screen field name
      append fmap.
      fmap-fldname = 'CONNID'.
      fmap-dyfldname = 'CONNID'.
      append fmap.
      fmap-fldname = 'FLDATE'.
      fmap-dyfldname = 'FLDATE'.
      append fmap.
      call function 'F4IF_INT_TABLE_VALUE_REQUEST'
        exporting
         ddic_structure         = 'SFLIGHT'
          retfield               = 'CARIID'
    *     PVALKEY                = ' '
         dynpprog               = sy-repid
         dynpnr                 = sy-dynnr
         dynprofield            = 'CARRID'
    *     STEPL                  = 0
    *     WINDOW_TITLE           =
    *     VALUE                  = ' '
         value_org              = 'S'
    *     MULTIPLE_CHOICE        = ' '
    *     DISPLAY                = ' '
    *     CALLBACK_PROGRAM       = ' '
    *     CALLBACK_FORM          = ' '
    *     MARK_TAB               =
    *   IMPORTING
    *     USER_RESET             =
        tables
          value_tab              = itab
    *     FIELD_TAB              =
    *     RETURN_TAB             =
         dynpfld_mapping        = fmap
    *   EXCEPTIONS
    *     PARAMETER_ERROR        = 1
    *     NO_VALUES_FOUND        = 2
    *     OTHERS                 = 3
                ." Just Execute this pilot program and verify
      if sy-subrc  eq 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      endif.
    Edited by: BreakPoint on Dec 22, 2011 2:41 PM

  • FM F4IF_INT_TABLE_VALUE_REQUEST do not return value in RETURN_TAB

    Hi all,
    I used the FM F4IF_INT_TABLE_VALUE_REQUEST to return the objid and stext and it is showing the search help in the selection screen, however, after i choose a value from the search help, the FM does not return me the value that i have choosen. The following is the code that I had written.
    DATA: lt_retval  TYPE STANDARD TABLE OF ddshretval,
            lwa_retval TYPE ddshretval.
      DATA: lt_field  TYPE STANDARD TABLE OF dfies,
            lwa_field TYPE dfies.
    CONSTANTS: lc_retfield       TYPE dfies-fieldname VALUE 'STEXT',
                           lc_value_org      TYPE c VALUE 'S'.
    lwa_field-fieldname = 'F0001'.
      lwa_field-langu     = sy-langu.
      lwa_field-position  = '1'.
      lwa_field-offset    = '0'.
      lwa_field-domname   = 'HROBJID'.
      lwa_field-rollname  = 'HROBJID'.
      lwa_field-leng      = '8'.
      lwa_field-intlen    = '16'.
      lwa_field-outputlen = '8'.
      lwa_field-datatype  = 'NUMC'.
      lwa_field-inttype   = 'N'.
      lwa_field-precfield = 'HROBJID'.
      lwa_field-headlen   = '8'.
      lwa_field-scrlen1   = '10'.
      lwa_field-scrlen2   = '15'.
      lwa_field-scrlen3   = '20'.
      lwa_field-fieldtext = 'Posting ID'.
      lwa_field-reptext   = 'Posting ID'.
      lwa_field-scrtext_s = 'PostingID'.
      lwa_field-scrtext_m = 'ID'.
      lwa_field-scrtext_l = 'Posting ID'.
    APPEND lwa_field TO lt_field.
      CLEAR lwa_values.
    lwa_field-fieldname = 'F0002'.
      lwa_field-langu     = sy-langu.
      lwa_field-position  = '2'.
      lwa_field-offset    = '16'.
      lwa_field-domname   = 'TEXT40'.
      lwa_field-rollname  = 'STEXT'.
      lwa_field-leng      = '40'.
      lwa_field-intlen    = '80'.
      lwa_field-outputlen = '40'.
      lwa_field-datatype  = 'CHAR'.
      lwa_field-inttype   = 'C'.
      lwa_field-precfield = 'STEXT'.
      lwa_field-headlen   = '40'.
      lwa_field-scrlen1   = '10'.
      lwa_field-scrlen2   = '15'.
      lwa_field-scrlen3   = '20'.
      lwa_field-fieldtext = 'Posting Text'.
      lwa_field-reptext   = 'Posting Text'.
      lwa_field-scrtext_s = 'PostingTxt'.
      lwa_field-scrtext_m = 'Text'.
      lwa_field-scrtext_l = 'Posting Text'.
      lwa_field-lowercase = 'X'.
    APPEND lwa_field TO lt_field.
      CLEAR lwa_values.
      IF lt_values IS NOT INITIAL.
        CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
          EXPORTING
            retfield        = lc_retfield
    *        dynpprog        = sy-repid
    *        dynpnr          = sy-dynnr
    *        dynprofield     = lc_fieldn
            value_org       = lc_value_org
          TABLES
            value_tab       = lt_values
            field_tab       = lt_field
            return_tab      = lt_retval
          EXCEPTIONS
            parameter_error = 1
            no_values_found = 2
            OTHERS          = 3.
        IF sy-subrc EQ 0.
          CLEAR lwa_retval.
          READ TABLE lt_retval INTO lwa_retval INDEX 1.
          IF sy-subrc EQ 0.
            MOVE lwa_retval-fieldval TO s_post-low.
            CLEAR lwa_retval.
          ENDIF.
        ELSE.
          MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                  WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDIF.
      ENDIF.
    Please assist, thanks so much.
    Edited by: yf wee on Oct 5, 2009 8:11 AM

    Hi,
    Refer this demo code:-
    PARAMETERS : p_belnr TYPE belnr,
                 p_bukrs TYPE bukrs.
    DATA : BEGIN OF itab OCCURS 0,
             belnr TYPE belnr,
           END OF itab.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_belnr.
      PERFORM f4_belnr_help USING p_belnr.
    *&      Form  f4_belnr_help
    *       text
    *      -->P_BELNR text
    FORM f4_belnr_help USING p_belnr.
      SELECT belnr from <db_table> INTO TABLE itab.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          retfield               = 'BELNR' "internal table field
          dynpprog               = 'Z_F4' "program name
          dynpnr                 = '1000' "screen number
          dynprofield            = 'P_BELNR' "screen field name
          value_org              = 'S'
        TABLES
          value_tab              = itab "internal table
        EXCEPTIONS
          PARAMETER_ERROR        = 1
          NO_VALUES_FOUND        = 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.                    " f4_belnr_help
    Hope this helps you.
    Regards,
    Tarun

  • 'F4IF_INT_TABLE_VALUE_REQUEST' is not returning any value when selecting da

    *Hello Guys.*
    *I hv inserted search help in an field of screen exit in T-code IW21. Its showing value properly when i press f4 but when selecting value its nt returning any value properly....*
    *I am pasting code ..please help me out*
    *. Process of value Request*
    *field <fieldname>  module F4_AGENCY*
    *MODULE F4_AGENCY INPUT.*
      *DATA: IT_AGENCY TYPE TABLE OF ZF4_AGENCY WITH HEADER LINE,*
            *it_FIELD_TAB      type table of DFIES WITH HEADER LINE,*
            *IT_DDSHRETVAL TYPE TABLE OF DDSHRETVAL WITH HEADER LINE.*
      *REFRESH : IT_AGENCY[].*
    *clear : VIQMEL-ZZAGENCY.*
    **SELECT * FROM ZF4_AGENCY INTO TABLE IT_AGENCY.**
      *CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'*
        *EXPORTING*
      DDIC_STRUCTURE           = 'ZF4_AGENCY'**
          *RETFIELD               = 'ZZAGENCY'*
        PVALKEY                 = ' '**
         *DYNPPROG                = sy-cprog  "'SAPLXQQM'*
         *DYNPNR                  = sy-dynnr   "'0101'*
         *DYNPROFIELD             = 'VIQMEL-ZZAGENCY'*
        STEPL                  = sy-stepl**
         *VALUE_ORG               = 'S'*
       *TABLES*
        *VALUE_TAB              = IT_AGENCY[]*
        *FIELD_TAB              = it_FIELD_TAB[]*
        *RETURN_TAB             =  IT_DDSHRETVAL[]*
      DYNPFLD_MAPPING        =**
    EXCEPTIONS**
      PARAMETER_ERROR        = 1**
      NO_VALUES_FOUND        = 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.*
    *wating for any reply*

    Did you take a look at the help for FM? pass the hardcoded value for DYNPPROG and DYNNR (and see if that works)
    DYNPPROG and DYNNR cannot be passed as SY-REPID and SY-DYNNR because they are only analyzed after the function module has been called. Instead, first copy the SY fields to local variables and then pass them to the function module.

  • Open Dataset for XML not reading the XML file, Returning Code 8.

    Dear all,
    Im trying to open an XML file using Open Dataset, since i have to execute this report in background and GUI_upload doesnt work in background.
    The XML file is available in my C:\, say, C:\xmlfile.xml.
    But  the open dataset is not reading any value into the g_xml_line . it is returning sy-subrc = 8.
    Below is my code for that, can anybody help me out to resolve.
    DATA : lv_filename LIKE rlgrap-filename.
      CLEAR: lv_filename.
      lv_filename = p_input.
      OPEN DATASET lv_filename FOR INPUT IN BINARY MODE.
      IF sy-subrc ne 0.
        WRITE:/ 'invalid file'.
      else.
      DO.
        READ DATASET lv_filename INTO  g_xml_line.
        IF sy-subrc EQ 0.
          APPEND g_xml_line TO g_xml_table.
        ELSE.
          EXIT.
        ENDIF.
      ENDDO.
      CLOSE DATASET lv_filename.
       ENDIF.
    TYPES: BEGIN OF t_xml_line,
            data(256) TYPE x,
          END OF t_xml_line.
    DATA: g_xml_table       TYPE TABLE OF t_xml_line,
          g_xml_line        TYPE t_xml_line,
          g_xml_table_size  TYPE i.
    GET REFERENCE OF gt_person INTO gs_result_xml-value.
      gs_result_xml-name = 'IPIX'.
      APPEND gs_result_xml TO gt_result_xml.
    Perform the XSLT stylesheet
      TRY.
          CALL TRANSFORMATION zaum_manh_sync_rpt
          SOURCE XML g_xml_table
          RESULT (gt_result_xml).
        CATCH cx_root INTO gs_rif_ex.
          gs_var_text = gs_rif_ex->get_text( ).
          MESSAGE gs_var_text TYPE 'E'.
      ENDTRY.
    Kindly suggest me a solution. Points assured
    regs,
    raja

    After saving the file , below is the code i wrote, but it gives a runtime error with message
    No roll storage space of length 3788808 available for internal storage.
    ***Coding****
    PARAMETERS: p_file TYPE pathintern LOWER CASE DEFAULT '/usr/sap/DEV/SYS/global/XMLABAP2.XML'.
    DATA : lv_filename LIKE rlgrap-filename.
      CLEAR: lv_filename.
      lv_filename = p_file.
      DATA: l_fname TYPE filename-fileintern. " File name
    *GET THE FILENAME FROM THE APPLICATION SERVER
      CALL FUNCTION '/SAPDMC/LSM_F4_SERVER_FILE'
        EXPORTING
          directory        = p_file
          filemask         = '*'
        IMPORTING
          serverfile       = l_fname
        EXCEPTIONS
          canceled_by_user = 1
          OTHERS           = 2.
      IF sy-subrc NE 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
        WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    */usr/sap/DEV/SYS/global/substanc
      lv_filename = l_fname.
      OPEN DATASET lv_filename FOR INPUT IN BINARY MODE.
      IF sy-subrc NE 0.
        WRITE:/ 'invalid file'.
      ELSE.
        DO.
          READ DATASET lv_filename INTO  g_xml_line.
       IF sy-subrc EQ 0.
          APPEND g_xml_line TO g_xml_table.
       ELSE.
         EXIT.
       ENDIF.
        ENDDO.
        CLOSE DATASET lv_filename.
      ENDIF.

  • ALV Grid and return to selection screen

    Hello
    I have an ALV Grid and when I push a buttom that I program appears another ALV Grid. In this second ALV I try to program different buttoms. When I program the BACK buttom I want to go to selection screen.
    I try with CALL SELECTION SCREEN but when I stay in selection screen and push the execute buttom the ALV that I see is the second, not the first. It seems that we don't catch the news selections.
    I put rs_selfied-refresh = 'X' after the CALL SELECTION SCREEN but is wrong again.
    What can I do????

    Hello Silvia
    There is a simple trick to return from the second ALV list directly back to the selection screen:
    *& Report  ZUS_SDN_REUSE_ALV_GRID_DISPLAY
    REPORT  zus_sdn_reuse_alv_grid_display.
    TYPE-POOLS: slis.
    DATA:
      gt_t001        TYPE STANDARD TABLE OF t001,
      gt_knb1        TYPE STANDARD TABLE OF knb1.
    DATA:
      gs_fcat        TYPE slis_fieldcat_alv,
      gt_fcat_t001   TYPE slis_t_fieldcat_alv,
      gt_fcat_knb1   TYPE slis_t_fieldcat_alv.
    PARAMETERS:
      p_bukrs        TYPE bukrs  DEFAULT '1000'.
    START-OF-SELECTION.
      SELECT * FROM  t001 INTO TABLE gt_t001.
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
        EXPORTING
    *     I_PROGRAM_NAME               =
    *     I_INTERNAL_TABNAME           =
          i_structure_name             = 'T001'
    *     I_CLIENT_NEVER_DISPLAY       = 'X'
    *     I_INCLNAME                   =
    *     I_BYPASSING_BUFFER           =
    *     I_BUFFER_ACTIVE              =
        CHANGING
          ct_fieldcat                  = gt_fcat_t001
        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.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
    *     I_INTERFACE_CHECK                 = ' '
    *     I_BYPASSING_BUFFER                = ' '
    *     I_BUFFER_ACTIVE                   = ' '
          i_callback_program                = syst-cprog
          i_callback_pf_status_set          = 'ALV_SET_PF_STATUS'
          i_callback_user_command           = 'ALV_USER_COMMAND'
    *     I_CALLBACK_TOP_OF_PAGE            = ' '
    *     I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
    *     I_CALLBACK_HTML_END_OF_LIST       = ' '
    *     I_STRUCTURE_NAME                  = ' '
    *     I_BACKGROUND_ID                   = ' '
    *     I_GRID_TITLE                      =
    *     I_GRID_SETTINGS                   =
    *     IS_LAYOUT                         =
          it_fieldcat                       = gt_fcat_t001
    *   IMPORTING
    *     E_EXIT_CAUSED_BY_CALLER           =
    *     ES_EXIT_CAUSED_BY_USER            =
        TABLES
          t_outtab                          = gt_t001
    *   EXCEPTIONS
    *     PROGRAM_ERROR                     = 1
    *     OTHERS                            = 2
      IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    END-OF-SELECTION.
    *&      Form  set_pf_status
    *       text
    *      -->RT_EXTAB   text
    FORM alv_set_pf_status USING rt_extab TYPE slis_t_extab.
    * NOTE: identical to STANDARD_FULLSCREEN with additional button
    *       for detail list ('DETAILLIST')
      SET PF-STATUS 'STANDARD_FULLSCREEN'.
    ENDFORM.                    "set_pf_status
    *&      Form  alv_user_command
    *       text
    *      -->R_UCOMM    text
    *      -->RS_SELFIELDtext
    FORM alv_user_command  USING r_ucomm LIKE sy-ucomm
                             rs_selfield TYPE slis_selfield.
      CASE r_ucomm.
    *   Display detail list: all customers for selected company code
        WHEN 'DETAILLIST'.
          IF ( rs_selfield-fieldname = 'BUKRS' ).
            SELECT        * FROM  knb1 INTO TABLE gt_knb1
                   WHERE  bukrs  = rs_selfield-value.
            CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
              EXPORTING
    *         I_INTERFACE_CHECK                 = ' '
    *         I_BYPASSING_BUFFER                = ' '
    *         I_BUFFER_ACTIVE                   = ' '
                i_callback_program                = syst-cprog
                i_callback_pf_status_set          = 'ALV_SET_PF_STATUS'
                i_callback_user_command           = 'ALV_USER_COMMAND'
    *         I_CALLBACK_TOP_OF_PAGE            = ' '
    *         I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
    *         I_CALLBACK_HTML_END_OF_LIST       = ' '
                i_structure_name                  = 'KNB1'
    *       IMPORTING
    *         E_EXIT_CAUSED_BY_CALLER           =
    *         ES_EXIT_CAUSED_BY_USER            =
              TABLES
                t_outtab                          = gt_knb1
              EXCEPTIONS
                program_error                     = 1
                OTHERS                            = 2.
            IF sy-subrc <> 0.
    *     MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
            ENDIF.
    <b>*       NOTE: when the program logic returns from the 2nd ALV list
    *             and exit = 'X' then the program leaves the
    *       1st ALV list, too, and returns to the selection screen.</b>
            rs_selfield-exit = 'X'.
          ENDIF.
        WHEN OTHERS.
      ENDCASE.
    ENDFORM.                    "alv_user_command
    Regards
      Uwe

Maybe you are looking for

  • Need help with INSERT and WITH clause

    I wrote sql statement which correctly work, but how i use this statment with INSERT query? NEED HELP. when i wrote insert i see error "ORA 32034: unsupported use of with clause" with t1 as( select a.budat,a.monat as period,b.vtweg, c.gjahr,c.buzei,c.

  • If I buy an iPhone 4s, is it ios 5?

    Hi, I'm planning on buying an unlocked iphone4s from an apple store. If I do buy the iphone 4s, it'll come preloaded with iOs 5 and not iOs 6 right? I want google back.

  • Acrobat Adobe 9 Std. User preferences do not save.

    I have Acrobat Adobe 9 Std installed on a windows 2008 R2 Terminal server.  User preferences do not save.  Any body have this issue?

  • Error while Installing BI_CONT 703

    I am Installing BI_CONT 703 including Support Package 9 using SAINT. That means I am installing SAPKIBIIIH SAPKIBIIP1 SAPKIBIIP2 SAPKIBIIP3 SAPKIBIIP4 SAPKIBIIP5 SAPKIBIIP6 SAPKIBIIP7 SAPKIBIIP8 SAPKIBIIP9 Other Installed Componenets are SAP_ABA     

  • Linker problem using version 12.4 on Linux

    I am trying to use Solaris Studio 12.4 on Linux ( OpenSuse 13.2 ). I have installed the compiler and set up the PATH to its bin directory. When I compile/link a program I am receiving: "sun.link ../../../bin.v2/libs/vmd/test/test_after_array_elem.tes