<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: interactive ALV in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/interactive-alv/m-p/3763952#M905602</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thankx&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 05 May 2008 10:37:55 GMT</pubDate>
    <dc:creator>Mohamed_Mukhtar</dc:creator>
    <dc:date>2008-05-05T10:37:55Z</dc:date>
    <item>
      <title>interactive ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/interactive-alv/m-p/3763950#M905600</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi ,&lt;/P&gt;&lt;P&gt;    A very gud day to u all experts.........&lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;P&gt;    In interactive ALV , is there any thing like &lt;STRONG&gt;HIDE&lt;/STRONG&gt; statement..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   Plz give me a examlple program for interactive alv&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   Thank you&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   with regards..&lt;/P&gt;&lt;P&gt;    Always learner&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 May 2008 10:32:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/interactive-alv/m-p/3763950#M905600</guid>
      <dc:creator>Mohamed_Mukhtar</dc:creator>
      <dc:date>2008-05-05T10:32:04Z</dc:date>
    </item>
    <item>
      <title>Re: interactive ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/interactive-alv/m-p/3763951#M905601</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;Check this out&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sap-img.com/abap/an-interactive-alv-report.htm" target="test_blank"&gt;http://www.sap-img.com/abap/an-interactive-alv-report.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Santosh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 May 2008 10:33:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/interactive-alv/m-p/3763951#M905601</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-05T10:33:58Z</dc:date>
    </item>
    <item>
      <title>Re: interactive ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/interactive-alv/m-p/3763952#M905602</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thankx&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 May 2008 10:37:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/interactive-alv/m-p/3763952#M905602</guid>
      <dc:creator>Mohamed_Mukhtar</dc:creator>
      <dc:date>2008-05-05T10:37:55Z</dc:date>
    </item>
    <item>
      <title>Re: interactive ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/interactive-alv/m-p/3763953#M905603</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In ALV there is no HIDE statement. U have to use User_command.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I_CALLBACK_USER_COMMAND &lt;/P&gt;&lt;P&gt;&amp;#149;EXIT routine for command handling &lt;/P&gt;&lt;P&gt;&amp;#150;Passing an EXIT routine tells ALV that the application wants to react to certain function codes itself. These are general function codes which ALV does not recognize (not ALV standard functions) and which were defined and set by an application status.&lt;/P&gt;&lt;P&gt;FORM user_command USING r_ucomm LIKE sy-ucomm rs_selfield TYPE slis_selfield.&lt;/P&gt;&lt;P&gt;&amp;#150;The parameter R_UCOMM contains the function code called.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;*&amp;amp;---------------------------------------------------------------------*
*&amp;amp; Report  ZM_REPT_BLOCK_VENDORS                                       *
*&amp;amp;                                                                     *
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;                                                                     *
*&amp;amp;                                                                     *
*&amp;amp;---------------------------------------------------------------------*



**********************************************************************
* Program name       : ZM_REPT_BLOCK_VENDORS                           *
*                                                                      *
* Title              : display and block vendors                       *
* Requestor          :                                           *
* Author             :                              *
* Date               :                                         *
*                                                                      *
* Functional contact :                                                 *
*                                                                      *
* Program description:  A report to select those vendors for whome     *
*                       purchase orders has not been passed since      *
*                       six months and all already passed purchase     *
*                       orders has been delivered, and then to block   *
*                       those selected vendors  by using BDC           *
*                       call transaction method                        *
*                                                                      *
*  Input Selection Screen: no selections                               *
*                                                                      *
*  Report Parameters:  no parameters                                   *
*  Report Output:      Check box                                       *
*                      vendor number     - LFA1-LIFNR                  *
*                      vendor  name      - LFA1-NAME1                  *
*                      company code      - LFB1-WERKS                  *
*                      PO number         - EKKO-EBELN                  *
*                      Item number       - EKPO-EBELP                  *
*                     Delivery indicator - EKPO-ELIKZ                  *
* -------------------------------------------------------------------- *
* MODIFICATIONS :                                                      *
**---------------------------------------------------------------------*
*               M A I N T E N A N C E    L O G                         *
*--------------------------------------------------------------------- *
*--D A T E---|--B Y--|-C H A N G E  N O.-| D E S C R I P T I O N ----- *
*            |       |                   |                             *
*--------------------------------------------------------------------- *

************************************************************************

REPORT  zm_rept_block_vendors  NO STANDARD PAGE HEADING LINE-SIZE 90
LINE-COUNT 30(3).                        .


*----------------------------------------------------------------------*
*  Tables - Database tables                                            *
*----------------------------------------------------------------------*
TABLES: ekko,lfa1,lfb1,ekpo.


*----------------------------------------------------------------------*
* data declaration part                                                *
*----------------------------------------------------------------------*

*INTERNAL TABLES.

DATA:BEGIN OF it_lfb1 OCCURS 0,
        lifnr LIKE lfa1-lifnr,
        name1 LIKE lfa1-name1,
        bukrs LIKE lfb1-bukrs,
     END OF it_lfb1.

DATA: BEGIN OF it_ekpo OCCURS 0,
         lifnr LIKE ekko-lifnr,
         ebeln LIKE ekko-ebeln,
         ebelp LIKE ekpo-ebelp,
         elikz LIKE ekpo-elikz,
      END OF it_ekpo.

DATA:  it_vendors LIKE TABLE OF it_ekpo WITH HEADER LINE.


*table to select all the vendors for whome no POs passed since six
*months.
DATA: BEGIN  OF it_vend OCCURS 0,

      lifnr LIKE lfa1-lifnr,
      name1 LIKE lfa1-name1,
      bukrs LIKE lfb1-bukrs,
      ebeln LIKE ekko-ebeln,
      ebelp LIKE ekpo-ebelp,
      elikz LIKE ekpo-elikz,

      END OF it_vend.

*internal table to select all vendors for whome there is no open items
DATA: BEGIN  OF it_block OCCURS 0,

      cbox ,
      lifnr LIKE lfa1-lifnr,
      name1 LIKE lfa1-name1,
      bukrs LIKE lfb1-bukrs,
      ebeln LIKE ekko-ebeln,
      ebelp LIKE ekpo-ebelp,
      elikz LIKE ekpo-elikz,

      END OF it_block.

*internal table to select vendors to be blocked for a perticular plant.
DATA: BEGIN OF it_select OCCURS 0,

     lifnr_001(016),
     bukrs_002(004),
     loevm_003(001),
     loevm_004(001),
     nodel_005(001),
     nodel_006(001),

     END OF it_select.

* internal table to handle the messages
DATA bdcdata    LIKE bdcdata    OCCURS 0 WITH HEADER LINE.


*DATA VERIABLES

DATA: w_aedat    LIKE sy-datum,   " for six months back date
      ok_code    LIKE sy-ucomm,   " to hold function codes
      currdate   LIKE sy-datum,   " To hold the current date
      backmonths TYPE i.

DATA: c1      TYPE i,    " counter for POs of each vendor
      c2      TYPE i,    " counter for delevery completed POs
      l_no    TYPE i,    " to store line no at list output
      tot_rec TYPE i.    " to store no of records in the basic list


*----------------------------------------------------------------------*
*  INITIALIZATION EVENT                                                *
*----------------------------------------------------------------------*
INITIALIZATION.

  currdate = sy-datum.
  backmonths = 6.

  PERFORM go_back_months USING currdate backmonths CHANGING  w_aedat.


*----------------------------------------------------------------------*
*  START-OF-SELECTION EVENT                                            *
*----------------------------------------------------------------------*
START-OF-SELECTION.


*selection statement to select all vendors for whome  POs has not been
*  passed for six months, and all POs and items for that vendor includng
*    company code

  PERFORM initial_selection.


*----------------------------------------------------------------------*
*  END-OF-SELECTION EVENT                                              *
*----------------------------------------------------------------------*
END-OF-SELECTION.

  SORT it_vend BY lifnr bukrs ebeln ebelp.

*to display all vendors for whom POs has not been passed for six months
*  PERFORM disply_all_vendors.

*to select those vendors into it_block  table for whom there is no open
*items
  PERFORM select_no_openitems.

*to display initial selection data.
  PERFORM display_initial_selection .

*  to set PF status for basic list.
  IF sy-lsind = 0.
    SET PF-STATUS 'RAM'.
  ENDIF.

*----------------------------------------------------------------------*
*  TOP-OF-PAGE EVENT                                                   *
*----------------------------------------------------------------------*
TOP-OF-PAGE.

* headings for basic list
  PERFORM top-of-page.


*----------------------------------------------------------------------*
*  TOP-OF-PAGE DURING LINE-SELECTION EVENT                             *
*----------------------------------------------------------------------*
TOP-OF-PAGE DURING LINE-SELECTION.

*  headings for secondary  list
  PERFORM top_of_page_for_second_list.


*----------------------------------------------------------------------*
*  AT USER-COMMAND EVENT                                               *
*----------------------------------------------------------------------*

AT USER-COMMAND.

  IF sy-lsind = 1.
    SET PF-STATUS 'RAM'.
  ENDIF.

  ok_code = sy-ucomm.

  CASE ok_code.


*   to select all vendors for all company codes from the basic list.
    WHEN 'SALL'.

      PERFORM select_all.

*   to deselect all vendors for all company codes from the basic list.

    WHEN 'DALL'.

      PERFORM deselect_all.

*  to store and display the selected vendors to be blocked
    WHEN 'SLCT'.

      PERFORM final_selection.

*     display the selected vendors and details to be blocked

      PERFORM display_final_selection.

    WHEN 'RBDC'.

      PERFORM final_selection.

*  to perform BDC by call transaction using table it_select.
      PERFORM run_bdc.
      
    WHEN 'RFRS'.

*    to refresh the output.
     SUBMIT ZM_REPT_BLOCK_VENDORS AND RETURN .

  ENDCASE.

  CLEAR ok_code.


*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  GO_BACK_MONTHS                                           *
*&amp;amp;---------------------------------------------------------------------*
*       text                                                           *
*----------------------------------------------------------------------*
*  --&amp;gt;  CURRDATE         text                                          *
*  --&amp;gt;  BACKMONTHS       text                                          *
*   &amp;lt;-- NEWDATE                                                        *
*----------------------------------------------------------------------*
FORM go_back_months USING value(currdate) value(backmonths)
                    CHANGING newdate.

  DATA: year(4)    TYPE c,
        tmonths    TYPE numc3,
        day(2)     TYPE c,
        leaf       TYPE i.

  MOVE: currdate(4) TO year,
        currdate+4(2) TO tmonths,
        currdate+6(2) TO day.

  IF tmonths &amp;lt;= backmonths.

    currdate(4) = currdate(4) - 1.
    currdate+4(2) = '12'.
    backmonths = backmonths - tmonths.

* call function recursively
    PERFORM go_back_months USING currdate backmonths CHANGING newdate.

  ELSE.
    newdate(4) = currdate(4).
    newdate+4(2) = currdate+4(2) - backmonths.
    newdate+6(2) = currdate+6(2).

    IF newdate+6(2) = '31'.

      IF newdate+4(2) = '01' OR newdate+4(2) = '03' OR
         newdate+4(2) = '05' OR newdate+4(2) = '07' OR
         newdate+4(2) = '08' OR newdate+4(2) = '10' OR
         newdate+4(2) = '12' .

        newdate+6(2) = '31'.

      ELSE.

        leaf = newdate(4) MOD 4.

        IF  leaf = 0 AND newdate+4(2) = 2.
          newdate+6(2) = '29'.
        ELSEIF newdate+4(2) = 2.
          newdate+6(2) = '28'.
        ELSE.
          newdate+6(2) = '30'.
        ENDIF.

      ENDIF.

    ELSEIF newdate+6(2) = '30' .

      leaf = newdate(4) MOD 4.

      IF  leaf = 0 AND newdate+4(2) = 2.
        newdate+6(2) = '29'.
      ELSEIF newdate+4(2) = 2.
        newdate+6(2) = '28'.
      ELSE.
        newdate+6(2) = '30'.
      ENDIF.

    ELSEIF newdate+6(2) = '29'.

      leaf = newdate(4) MOD 4.

      IF  leaf = 0 AND newdate+4(2) = 2.
        newdate+6(2) = '29'.
      ELSEIF newdate+4(2) = 2.
        newdate+6(2) = '28'.
      ENDIF.

    ENDIF.

  ENDIF.    "IF TMONTHS &amp;lt;= BACKMONTHS.


ENDFORM.                    " GO_BACK_MONTHS

*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  initial_selection                                        *
*&amp;amp;---------------------------------------------------------------------*
FORM initial_selection .

  SELECT k~lifnr k~ebeln p~ebelp p~elikz
     FROM ekko AS k INNER JOIN ekpo AS p ON k~ebeln = p~ebeln
     INTO TABLE it_ekpo WHERE k~aedat &amp;lt; w_aedat.

  SORT it_ekpo BY lifnr.
  LOOP AT it_ekpo.
    MOVE-CORRESPONDING it_ekpo TO it_vendors.
  ENDLOOP.

  LOOP AT it_vendors.
    DELETE ADJACENT DUPLICATES FROM it_vendors COMPARING lifnr.
  ENDLOOP.

  IF NOT it_vendors[] IS INITIAL.
    SELECT l~lifnr l~name1 b~bukrs
        FROM  lfa1 AS l INNER JOIN lfb1 AS b ON l~lifnr = b~lifnr
        INTO TABLE it_lfb1
        FOR ALL ENTRIES IN it_vendors WHERE l~lifnr = it_vendors-lifnr.
  ENDIF.

  LOOP AT it_ekpo.
    READ TABLE it_lfb1 WITH KEY lifnr = it_ekpo-lifnr.
    MOVE-CORRESPONDING it_ekpo TO it_vend.
    MOVE: it_lfb1-name1 TO it_vend-name1,
          it_lfb1-bukrs TO it_vend-bukrs.
    APPEND it_vend.
    CLEAR  it_vend.
  ENDLOOP.

ENDFORM.                    " initial_selection

*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  select_no_openitems                                      *
*&amp;amp;---------------------------------------------------------------------*
FORM select_no_openitems .

  LOOP AT it_vend.

    ON CHANGE OF it_vend-lifnr.
      CLEAR c1.
      CLEAR c2.
    ENDON.

    ADD 1 TO c1.

    IF it_vend-elikz = 'X'.
      ADD 1 TO c2.
    ENDIF.

    AT END OF lifnr.

      IF c1 = c2.
        READ TABLE it_vend INDEX sy-tabix.
        MOVE-CORRESPONDING it_vend TO it_block.
        APPEND it_block.
        CLEAR it_block.
      ENDIF.

    ENDAT.

  ENDLOOP.


ENDFORM.                    " select_no_openitems

*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  display_initial_selection                                *
*&amp;amp;---------------------------------------------------------------------*
FORM display_initial_selection  .

  tot_rec = 0.
  FORMAT COLOR 2.
  LOOP AT it_block.

    WRITE:/ '|',5 it_block-cbox AS CHECKBOX,
            10 it_block-lifnr, 21 '|',
            22 it_block-name1, 53 '|',
            54 it_block-bukrs, 58 '|',
            59 it_block-ebeln, 70 '|',
            71 it_block-ebelp, 77 '|',
            78 it_block-elikz, 87 '|'.
    ADD 1 TO tot_rec.
  ENDLOOP.
  FORMAT RESET.
  ULINE (87).
ENDFORM.                    " display_initial_selection

*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  TOP-OF-PAGE                                              *
*&amp;amp;---------------------------------------------------------------------*
FORM top-of-page .

  WRITE: /30 'VENDORS WHO CAN BE BLOCKED' COLOR 6.
  ULINE.

  FORMAT COLOR 5 INVERSE INTENSIFIED.
  WRITE:/ 'PROG.NAME:',sy-repid, AT 40 'Company Name: GTECH',
               AT  70 'User:',
  sy-uname(6),
        / 'Date:',sy-datum,AT 40 'Time:',sy-uzeit, AT 70 'PageNo:',
sy-pagno.
  ULINE.
  FORMAT RESET.
  SKIP.

  ULINE (87).
  FORMAT COLOR 1.
  WRITE:/ '|', 5 'PICK',
          10 'VENDOR',21 '|',
          22 'NAME OF THE VENDOR',53 '|',
          54 'CO.CODE',58 '|',
          59 'PO NUBER',70 '|',
          71 'ITEM NO',77 '|',
          78 'DELV IND' ,87 '|'.
  FORMAT RESET.
  ULINE (87).


ENDFORM.                    " top-of-page

*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  top_of_page_for_second_list                              *
*&amp;amp;---------------------------------------------------------------------*
FORM top_of_page_for_second_list .

  WRITE: /30 'VENDORS TO BE BLOCKED' COLOR 6.
  ULINE.
  FORMAT COLOR 1.
  WRITE:  /5  'VENDOR',16 '|',
          17 'CO.CODE',22 '|',
          23 'DEL.FLAG ALL AREAS',41 '|',
          42 'DEL.FLAG SEL.CO.COD',62 '|',
          63 'DEL.FLAG GEN.DATA',83 '|',
          84 'DEL FLAG SEL.CO.COD',103'|'.
  FORMAT RESET.
  ULINE.


ENDFORM.                    " top_of_page_for_second_list

*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  select_all                                               *
*&amp;amp;---------------------------------------------------------------------*
FORM select_all .

  l_no = 7.

  DO.
    READ LINE l_no FIELD VALUE
         it_block-cbox it_block-lifnr it_block-bukrs.
    IF sy-subrc NE 0.
      EXIT.
    ENDIF.

    MODIFY LINE l_no OF CURRENT PAGE FIELD VALUE it_block-cbox FROM 'X'
    .



    ADD 1 TO l_no.

  ENDDO.



ENDFORM.                    " select_all

*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  deselect_all                                             *
*&amp;amp;---------------------------------------------------------------------*
FORM deselect_all .

  l_no = 7.

  DO.
    READ LINE l_no FIELD VALUE
         it_block-cbox it_block-lifnr it_block-bukrs.

    IF sy-subrc NE 0.
      EXIT.
    ENDIF.
    MODIFY LINE l_no FIELD VALUE it_block-cbox FROM ' ' .


    ADD 1 TO l_no.

  ENDDO.


ENDFORM.                    " deselect_all

*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  final_selection                                          *
*&amp;amp;---------------------------------------------------------------------*
FORM final_selection .

  l_no = 10.
  REFRESH it_select.

  DO tot_rec TIMES.
    READ LINE l_no  FIELD VALUE
        it_block-cbox it_block-lifnr it_block-bukrs.
    IF sy-subrc NE 0.
      EXIT.
    ENDIF.
    IF it_block-cbox = 'X'.

      MOVE: it_block-lifnr TO it_select-lifnr_001,
            it_block-bukrs TO it_select-bukrs_002,
              ' '         TO it_select-loevm_003,
              'X'         TO it_select-loevm_004,
              ' '         TO it_select-nodel_005,
              'X'         TO it_select-nodel_006.

      APPEND it_select.
      CLEAR it_select.

    ENDIF.


    ADD 1 TO l_no.

  ENDDO.

ENDFORM.                    " final_selection

*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  display_final_selection                                  *
*&amp;amp;---------------------------------------------------------------------*

FORM display_final_selection .

  SET PF-STATUS 'RAM1'.

  FORMAT COLOR 2.
  LOOP AT it_select.

    WRITE: /5  it_select-lifnr_001,16 '|',
            17 it_select-bukrs_002,22 '|',
            23 it_select-loevm_003,41 '|',
            42 it_select-loevm_004,62 '|',
            63 it_select-nodel_005,83 '|',
            84 it_select-nodel_006,103 '|'.

  ENDLOOP.
  FORMAT RESET.

ENDFORM.                    " display_final_selection


*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  run_bdc                                                  *
*&amp;amp;---------------------------------------------------------------------*

FORM run_bdc .


  DATA bdcmsgcoll LIKE bdcmsgcoll OCCURS 0 WITH HEADER LINE.

  DATA v_msg(150).


  LOOP AT it_select.

    PERFORM bdc_dynpro      USING 'SAPMF02K' '0500'.
    PERFORM bdc_field       USING 'BDC_CURSOR'
                                  'RF02K-BUKRS'.
    PERFORM bdc_field       USING 'BDC_OKCODE'
                                  '/00'.
    PERFORM bdc_field       USING 'RF02K-LIFNR'
                                  it_select-lifnr_001.
    PERFORM bdc_field       USING 'RF02K-BUKRS'
                                  it_select-bukrs_002.
    PERFORM bdc_dynpro      USING 'SAPMF02K' '0520'.
    PERFORM bdc_field       USING 'BDC_CURSOR'
                                  'LFA1-NODEL'.
    PERFORM bdc_field       USING 'BDC_OKCODE'
                                  '=UPDA'.
    PERFORM bdc_field       USING 'LFA1-LOEVM'
                                  it_select-loevm_003.
    PERFORM bdc_field       USING 'LFB1-LOEVM'
                                  it_select-loevm_004.
    PERFORM bdc_field       USING 'LFA1-NODEL'
                                  it_select-nodel_005.
    PERFORM bdc_field       USING 'LFB1-NODEL'
                                  it_select-nodel_006.

    CALL TRANSACTION 'XK06' USING bdcdata
                  UPDATE 'S'
                  MODE 'E'
                  MESSAGES  INTO bdcmsgcoll.


    IF sy-subrc EQ 0.

*  calling a funstion module to get the message
      CALL FUNCTION 'FORMAT_MESSAGE'
        EXPORTING
          id  = sy-msgid
          no  = sy-msgno
          v1  = sy-msgv1
          v2  = sy-msgv2
          v3  = sy-msgv3
          v4  = sy-msgv4
        IMPORTING
          msg = v_msg.

*    Printing  messages
      WRITE:/10 v_msg.

    ENDIF.

    REFRESH bdcdata.
  ENDLOOP.

ENDFORM.                    " run_bdc



*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      FORM BDC_DYNPRO                                                *
*&amp;amp;---------------------------------------------------------------------*

FORM bdc_dynpro USING program dynpro.

  CLEAR bdcdata.
  bdcdata-program  = program.
  bdcdata-dynpro   = dynpro.
  bdcdata-dynbegin = 'X'.
  APPEND bdcdata.

ENDFORM.                    "BDC_DYNPRO


*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      FORM BDC_FIELD                                                 *
*&amp;amp;---------------------------------------------------------------------*

FORM bdc_field USING fnam fval.

  CLEAR bdcdata.
  bdcdata-fnam = fnam.
  bdcdata-fval = fval.
  APPEND bdcdata.

ENDFORM.                   "BDC_FIELD


*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  disply_all_vendors                                       *
*&amp;amp;---------------------------------------------------------------------*
FORM disply_all_vendors .
  FORMAT COLOR 1.
  WRITE:  /2 'VENDOR NO', 14 '|',
          15 'CO.CODE',   20 '|',
          21 'PO NUMBER', 32 '|',
          33 'ITEM NO',   38 '|',
          39 'DEL.IND',   46 '|'.
  FORMAT RESET.

  FORMAT COLOR 2.
  LOOP AT it_vend.
    WRITE:   /2 it_vend-lifnr, 14 '|',
             15 it_vend-bukrs, 20 '|',
             21 it_vend-ebeln, 32 '|',
             33 it_vend-ebelp, 38 '|',
             39 it_vend-elikz, 46 '|'.
  ENDLOOP.
  FORMAT RESET.


ENDFORM.                    " disply_all_vendors&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 May 2008 10:38:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/interactive-alv/m-p/3763953#M905603</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-05T10:38:56Z</dc:date>
    </item>
    <item>
      <title>Re: interactive ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/interactive-alv/m-p/3763954#M905604</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi check this..there is no command in the alv with hide ..but you can use this field for hiding fields ...for interactive alv there is no reqirement for the hide statement in alv ....but you can do it with user command&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are creating the Field catalog manually,&lt;/P&gt;&lt;P&gt;then while creating the field catalog for the column which you want to hide write the following line:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;gs_fieldcat-fieldname = 'Column Name'.&lt;/P&gt;&lt;P&gt;gs_fieldcat-no_out = 'X'.&lt;/P&gt;&lt;P&gt;append gs_fieldcat to gt_fieldcat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If are using REUSE_ALV_FIELDCATALOG_MERGE for field catalog:&lt;/P&gt;&lt;P&gt;loop at gt_fieldcat into gs_fieldcat.&lt;/P&gt;&lt;P&gt;if gs_fieldcat-fieldname = 'Column name'.&lt;/P&gt;&lt;P&gt;gs_fieldcat-no_out = 'X'.&lt;/P&gt;&lt;P&gt;append gs_fieldcat to gt_fieldcat.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;venkat.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 May 2008 10:41:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/interactive-alv/m-p/3763954#M905604</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-05T10:41:33Z</dc:date>
    </item>
    <item>
      <title>Re: interactive ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/interactive-alv/m-p/3763955#M905605</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;slis_selfield is used to hole the value.&lt;/P&gt;&lt;P&gt;                .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT  ZDE_INTERACTIVEALV line-count 5(2).&lt;/P&gt;&lt;P&gt;tables: vbak, vbap.&lt;/P&gt;&lt;P&gt;type-pools: slis.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;types: begin of ty_vbak,&lt;/P&gt;&lt;P&gt;vbeln type vbeln,&lt;/P&gt;&lt;P&gt;kunnr type kunnr,&lt;/P&gt;&lt;P&gt;date type audat,&lt;/P&gt;&lt;P&gt;end of ty_vbak.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;types: begin of ty_vbap,&lt;/P&gt;&lt;P&gt;matnr type matnr,&lt;/P&gt;&lt;P&gt;end of ty_vbap.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : i_list_top_of_page TYPE slis_t_listheader.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: i_vbak type table of ty_vbak,&lt;/P&gt;&lt;P&gt;      i_vbap type table of ty_vbap.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: w_vbak type ty_vbak,&lt;/P&gt;&lt;P&gt;      w_vbap type ty_vbap.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : i_fieldcat type slis_t_fieldcat_alv,&lt;/P&gt;&lt;P&gt;       w_fieldcat type slis_fieldcat_alv,&lt;/P&gt;&lt;P&gt;       i_fieldcat1 type slis_t_fieldcat_alv,&lt;/P&gt;&lt;P&gt;       w_fieldcat1 type slis_fieldcat_alv,&lt;/P&gt;&lt;P&gt;       i_event type slis_t_event with header line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: w_layout TYPE slis_layout_alv,&lt;/P&gt;&lt;P&gt;       i_excluding TYPE slis_t_extab,&lt;/P&gt;&lt;P&gt;       w_excluding TYPE slis_extab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;selection-screen begin of block b1.&lt;/P&gt;&lt;P&gt;select-options: cust for vbak-kunnr.&lt;/P&gt;&lt;P&gt;selection-screen end of block b1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select vbeln from vbak into table i_vbak where kunnr in cust.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;perform fieldcat.&lt;/P&gt;&lt;P&gt;perform event.&lt;/P&gt;&lt;P&gt;perform display.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form display. &lt;/P&gt;&lt;P&gt;                CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'&lt;/P&gt;&lt;P&gt;                 EXPORTING&lt;/P&gt;&lt;P&gt;                   I_CALLBACK_PROGRAM                = sy-repid&lt;/P&gt;&lt;P&gt;                   I_CALLBACK_USER_COMMAND      = 'CLICK'&lt;/P&gt;&lt;P&gt;                   IT_FIELDCAT                       = i_fieldcat&lt;/P&gt;&lt;P&gt;                   IT_EVENTS                         = i_event[]&lt;/P&gt;&lt;P&gt;                  TABLES&lt;/P&gt;&lt;P&gt;                    t_outtab                          = i_vbak[].&lt;/P&gt;&lt;P&gt;endform.                    " display&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form fieldcat .&lt;/P&gt;&lt;P&gt;w_fieldcat-fieldname = 'VBELN'.&lt;/P&gt;&lt;P&gt;w_fieldcat-tabname = 'i_vbak'.&lt;/P&gt;&lt;P&gt;w_fieldcat-ref_fieldname = 'VBELN'.&lt;/P&gt;&lt;P&gt;w_fieldcat-seltext_m = 'Doc no'.&lt;/P&gt;&lt;P&gt;append w_fieldcat to i_fieldcat.&lt;/P&gt;&lt;P&gt;clear w_fieldcat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform.                    " fieldcat&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form event .&lt;/P&gt;&lt;P&gt; i_event-name = 'USER_COMMAND'.&lt;/P&gt;&lt;P&gt; i_event-form = 'CLICK'.&lt;/P&gt;&lt;P&gt;  APPEND i_event.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform.     " event&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM CLICK USING V_UCOMM LIKE SY-UCOMM HIDEV TYPE slis_selfield.&lt;/P&gt;&lt;P&gt;SELECT MATNR FROM VBAP INTO TABLE I_VBAP WHERE VBELN = HIDEV-value.&lt;/P&gt;&lt;P&gt;perform layout.&lt;/P&gt;&lt;P&gt;perform fieldcat1.&lt;/P&gt;&lt;P&gt;PERFORM GRID.&lt;/P&gt;&lt;P&gt;ENDFORM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form GRID .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'&lt;/P&gt;&lt;P&gt; EXPORTING&lt;/P&gt;&lt;P&gt;   I_CALLBACK_PROGRAM                = SY-REPID&lt;/P&gt;&lt;P&gt;   IT_FIELDCAT                       = I_FIELDCAT1&lt;/P&gt;&lt;P&gt;   IT_EXCLUDING                      = i_excluding&lt;/P&gt;&lt;P&gt;  TABLES&lt;/P&gt;&lt;P&gt;    t_outtab                          = i_vbap[].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform.                    " GRID&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form fieldcat1 .&lt;/P&gt;&lt;P&gt;CLEAR I_FIELDCAT1[].&lt;/P&gt;&lt;P&gt;w_fieldcat1-fieldname = 'MATNR'.&lt;/P&gt;&lt;P&gt;w_fieldcat1-tabname = 'I_VBAP'.&lt;/P&gt;&lt;P&gt;w_fieldcat1-seltext_m = 'Material No'.&lt;/P&gt;&lt;P&gt;append w_fieldcat1 to i_fieldcat1.&lt;/P&gt;&lt;P&gt;clear w_fieldcat1.&lt;/P&gt;&lt;P&gt;endform.                    " fieldcat1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think it is useful for you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 May 2008 10:52:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/interactive-alv/m-p/3763955#M905605</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-05T10:52:57Z</dc:date>
    </item>
    <item>
      <title>Re: interactive ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/interactive-alv/m-p/3763956#M905606</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi , thanks a lot...........&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 May 2008 11:00:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/interactive-alv/m-p/3763956#M905606</guid>
      <dc:creator>Mohamed_Mukhtar</dc:creator>
      <dc:date>2008-05-05T11:00:54Z</dc:date>
    </item>
    <item>
      <title>Re: interactive ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/interactive-alv/m-p/3763957#M905607</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thx&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Jul 2008 03:17:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/interactive-alv/m-p/3763957#M905607</guid>
      <dc:creator>Mohamed_Mukhtar</dc:creator>
      <dc:date>2008-07-25T03:17:31Z</dc:date>
    </item>
  </channel>
</rss>

