BDC programming and table controls selColumns

Hello,
I have a small question regarding BDC programming. I am already quite familiar with the process in creating one but I have one question regarding table control and its selColumns.
Transactions like pa40 would require its users to select one of the rows in the table controls via SelColumns. My questions is how would you simulate this using BDC.
Thanks people and take care.

Hai Chad Cheng
report Z_TAB_CONTRL_01
       no standard page heading line-size 255.
data : begin of it_kna1 occurs 0,
       kunnr like RF02D-KUNNR,
       D0130 like RF02D-D0130,
       end of it_kna1.
data : begin of it_kna2 occurs 0,
       kunnr like RF02D-KUNNR,
       BANKS like KNBK-BANKS,
       BANKL like KNBK-BANKL,
       BANKN like KNBK-BANKN,
       koinh like KNBK-koinh,
       end of it_kna2.
data : V_Count(2) type n.
data : V_Val(15).
include bdcrecx1.
start-of-selection.
  perform Get_Data1.
  perform Get_Data2.
perform open_group.
loop at it_kna1.
V_Count = '04'.
perform bdc_dynpro      using 'SAPMF02D' '0106'.
perform bdc_field       using 'BDC_CURSOR'
                              'RF02D-D0130'.
perform bdc_field       using 'BDC_OKCODE'
                              '/00'.
perform bdc_field       using 'RF02D-KUNNR'
                              '10002103'.
perform bdc_field       using 'RF02D-D0130'
                              'X'.
perform bdc_dynpro      using 'SAPMF02D' '0130'.
perform bdc_field       using 'BDC_OKCODE'
                              '=P+'.
perform bdc_dynpro      using 'SAPMF02D' '0130'.
perform bdc_field       using 'BDC_OKCODE'
                              '=P+'.
perform bdc_dynpro      using 'SAPMF02D' '0130'.
loop at it_kna2 where kunnr = it_kna1-kunnr.
if v_count = '10'.
perform bdc_field       using 'BDC_OKCODE'
                              '=P+'.
perform bdc_dynpro      using 'SAPMF02D' '0130'.
v_count = '00'.
endif.
V_Count = V_Count + 1.
concatenate 'KNBK-KOINH(' V_Count ')' into V_Val.
perform bdc_field       using 'BDC_CURSOR'
                               'KNBK-KOINH(09)'.
concatenate 'KNBK-BANKS(' V_Count ')' into V_Val.
perform bdc_field       using V_Val
                              it_kna2-BANKS.
concatenate 'KNBK-BANKL(' V_Count ')' into V_Val.
perform bdc_field       using V_Val
                              it_kna2-BANKL.
concatenate 'KNBK-BANKN(' V_Count ')' into V_Val.
perform bdc_field       using V_Val
                              it_kna2-BANKN.
concatenate 'KNBK-KOINH(' V_Count ')' into V_Val.
perform bdc_field       using V_Val
                              it_kna2-KOINH.
endloop.
perform bdc_field       using 'BDC_OKCODE'
                              '=UPDA'.
perform bdc_transaction using 'FD02'.
clear : it_kna1,it_kna2.
endloop.
perform close_group.
*&      Form  Get_Data1
      text
-->  p1        text
<--  p2        text
FORM Get_Data1 .
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
  CODEPAGE                      = ' '
   FILENAME                      = 'C:\tab_contl.txt'
   FILETYPE                      = 'ASC'
  ITEM                          = ' '
  FILEMASK_MASK                 = ' '
  FILEMASK_TEXT                 = ' '
  FILETYPE_NO_CHANGE            = ' '
  FILEMASK_ALL                  = ' '
  FILETYPE_NO_SHOW              = ' '
  LINE_EXIT                     = ' '
  USER_FORM                     = ' '
  USER_PROG                     = ' '
  SILENT                        = 'S'
IMPORTING
  FILESIZE                      =
  CANCEL                        =
  ACT_FILENAME                  =
  ACT_FILETYPE                  =
  TABLES
    DATA_TAB                      = it_kna1
EXCEPTIONS
  CONVERSION_ERROR              = 1
  INVALID_TABLE_WIDTH           = 2
  INVALID_TYPE                  = 3
  NO_BATCH                      = 4
  UNKNOWN_ERROR                 = 5
  GUI_REFUSE_FILETRANSFER       = 6
  OTHERS                        = 7
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.                    " Get_Data1
*&      Form  Get_Data2
      text
-->  p1        text
<--  p2        text
FORM Get_Data2 .
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
  CODEPAGE                      = ' '
   FILENAME                      = 'C:\tab_cont1.txt'
   FILETYPE                      = 'ASC'
  ITEM                          = ' '
  FILEMASK_MASK                 = ' '
  FILEMASK_TEXT                 = ' '
  FILETYPE_NO_CHANGE            = ' '
  FILEMASK_ALL                  = ' '
  FILETYPE_NO_SHOW              = ' '
  LINE_EXIT                     = ' '
  USER_FORM                     = ' '
  USER_PROG                     = ' '
  SILENT                        = 'S'
IMPORTING
  FILESIZE                      =
  CANCEL                        =
  ACT_FILENAME                  =
  ACT_FILETYPE                  =
  TABLES
    DATA_TAB                      = it_kna2
EXCEPTIONS
  CONVERSION_ERROR              = 1
  INVALID_TABLE_WIDTH           = 2
  INVALID_TYPE                  = 3
  NO_BATCH                      = 4
  UNKNOWN_ERROR                 = 5
  GUI_REFUSE_FILETRANSFER       = 6
  OTHERS                        = 7
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.                    " Get_Data2
Thanks & regards
Sreenivasulu P

Similar Messages

  • BDC Program for table control

    Hi Friends,
    I have an issue i am stuck here,
    i have to create BDC Program for XK01 tcode,
    and my requirement is that,
    i have three users first user want only three colum and second user want four column
    and third user want five column in table control,
    so how could i achieve it,
    please hekp me out.
    Thanks
    Vikash

    Hi Vikash,
    FORM bdc_dynpro  USING  p_program p_dynpro.
    IF user-one.
    FORM bdc_field  USING  fnam1 fval.
    FORM bdc_field  USING  fnam2 fval.
    FORM bdc_field  USING  fnam3 fval.
    ELSEIF user-two.
    FORM bdc_field  USING  fnam1 fval.
    FORM bdc_field  USING  fnam2 fval.
    FORM bdc_field  USING  fnam3 fval.
    FORM bdc_field  USING  fnam4 fval.
    ELSEIF user-three.
    FORM bdc_field  USING  fnam1 fval.
    FORM bdc_field  USING  fnam2 fval.
    FORM bdc_field  USING  fnam3 fval.
    FORM bdc_field  USING  fnam4 fval.
    FORM bdc_field  USING  fnam5 fval.
    ENDIF.
    Does this make sense?
    regards,
    Archer.

  • Program for table control in bdc

    Hi All,
        Can Anybody provide me program on table control that used in BDC.
        Please provide me program also.
    thanks
    rahul.

    Hi,
    Check this sample code:
    report zcustomer_change_bict
           no standard page heading line-size 255.
    include bdcrecx1.
    data: begin of it_record occurs 0,
            kunnr like rf02d-kunnr,
            d0360 like rf02d-d0360,
            anred(30) type c,
            name1(35) type c,
            namev(35) type c,
            telf1(35) type c,
            abtnr(10) type c,
          end of it_record.
    data: begin of it_knvk1 occurs 0,
          anred like knvk-anred,
          end of it_knvk1.
    data: begin of it_knvk2 occurs 0,
          name1 like knvk-name1,
          end of it_knvk2.
    data: begin of it_knvk3 occurs 0,
          namev like knvk-namev,
          end of it_knvk3.
    data: begin of it_knvk4 occurs 0,
          telf1 like knvk-telf1,
          end of it_knvk4.
    data: begin of it_knvk5 occurs 0,
          abtnr like knvk-abtnr,
          end of it_knvk5.
    data : fld(20) type c,
           cnt(2) type n.
    start-of-selection.
      call function 'GUI_UPLOAD'
        exporting
          filename                      = 'C:\CUSTCH.TXT'
         filetype                      = 'ASC'
        has_field_separator            = 'X'
      HEADER_LENGTH                 = 0
      READ_BY_LINE                  = 'X'
      DAT_MODE                      = ' '
      CODEPAGE                      = ' '
      IGNORE_CERR                   = ABAP_TRUE
      REPLACEMENT                   = '#'
      CHECK_BOM                     = ' '
      VIRUS_SCAN_PROFILE            = VIRUS_SCAN_PROFILE
      NO_AUTH_CHECK                 = ' '
    IMPORTING
      FILELENGTH                    = FILELENGTH
      HEADER                        = HEADER
        tables
          data_tab                      = it_record
    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
       others                        = 17
      if sy-subrc <> 0.
        message id sy-msgid type sy-msgty number sy-msgno
                with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      endif.
      perform open_group.
      loop at it_record.
        refresh bdcdata.
        refresh: it_knvk1,it_knvk2,it_knvk3,it_knvk4,it_knvk5.
        split it_record-anred at ',' into table it_knvk1.
        split it_record-name1 at ',' into table it_knvk2.
        split it_record-namev at ',' into table it_knvk3.
        split it_record-telf1 at ',' into table it_knvk4.
        split it_record-abtnr at ',' into table it_knvk5.
    screen 101
        perform bdc_dynpro      using 'SAPMF02D' '0101'.
        perform bdc_field       using 'BDC_CURSOR'
                                      'RF02D-D0360'.
        perform bdc_field       using 'BDC_OKCODE'
                                      '/00'.
        perform bdc_field       using 'RF02D-KUNNR'
                                      it_record-kunnr.
        perform bdc_field       using 'RF02D-D0360'
                                      it_record-d0360.
    screen 360
        perform bdc_dynpro      using 'SAPMF02D' '0360'.
        perform bdc_field       using 'BDC_CURSOR'
                                      'KNVK-ABTNR(01)'.
        perform bdc_field       using 'BDC_OKCODE'
                                      '=ENTR'.
    *perform bdc_field       using 'KNVK-ANRED(01)'
                                 record-ANRED_01_003.
    *perform bdc_field       using 'KNVK-NAMEV(01)'
                                 record-NAMEV_01_004.
    *perform bdc_field       using 'KNVK-NAME1(01)'
                                 record-NAME1_01_005.
    *perform bdc_field       using 'KNVK-TELF1(01)'
                                 record-TELF1_01_006.
    *perform bdc_field       using 'KNVK-ABTNR(01)'
                                 record-ABTNR_01_007.
        move 1 to cnt.
        loop at it_knvk1 .
          concatenate 'knvk-anred( ' cnt ' ) ' into fld.
          perform bdc_field using fld it_knvk1-anred.
          cnt = cnt + 1.
        endloop.
        move 1 to cnt.
        loop at it_knvk2 .
          concatenate 'knvk-name1( ' cnt ' ) ' into fld.
          perform bdc_field using fld it_knvk2-name1.
          cnt = cnt + 1.
        endloop.
        move 1 to cnt.
        loop at it_knvk3 .
          concatenate 'knvk-namev( ' cnt ' ) ' into fld.
          perform bdc_field using fld it_knvk3-namev.
          cnt = cnt + 1.
        endloop.
        move 1 to cnt.
        loop at it_knvk4 .
          concatenate 'knvk-telf1( ' cnt ' ) ' into fld.
          perform bdc_field using fld it_knvk4-telf1.
          cnt = cnt + 1.
        endloop.
        move 1 to cnt.
        loop at it_knvk5 .
          concatenate 'knvk-abtnr( ' cnt ' ) ' into fld.
          perform bdc_field using fld it_knvk5-abtnr.
          cnt = cnt + 1.
        endloop.
    screen 360
        perform bdc_dynpro      using 'SAPMF02D' '0360'.
        perform bdc_field       using 'BDC_CURSOR'
                                      'KNVK-NAMEV(01)'.
        perform bdc_field       using 'BDC_OKCODE'
                                      '=ENTR'.
        perform bdc_transaction using 'XD02'.
      endloop.
      perform close_group.

  • BDC coding for TABLE controls

    how to write BDC coding based on Table Controls...

    http://www.sap-basis-abap.com/abap/handling-table-control-in-bdc.htm
    How to deal with table control / step loop in BDC
    Steploop and table contol is inevitable in certain transactions. When we run BDC for such transactions, we will face the situation: how many visible lines of steploop/tablecontrol are on the screen? Although we can always find certain method to deal with it, such as function code 'NP', 'POPO', considering some extreme situation: there is only one line visible one the screen, our BDC program should display an error message. (See transaction 'ME21', we you resize your screen to let only one row visible, you can not enter mutiple lines on this screen even you use 'NP')
    Now with the help of Poonam on sapfans.com developement forum, I find a method with which we can determine the number of visible lines on Transaction Screen from our Calling BDC program. Maybe it is useless to you, but I think it will give your some idea.
    Demo ABAP code has two purposes:
    1. how to determine number of visible lines and how to calculte page number;
    (the 'calpage' routine has been modify to meet general purpose usage)
    2. using field symbol in BDC program, please pay special attention to the difference in Static ASSIGN and Dynamic ASSIGN.
    Now I begin to describe the step to implement my method:
    (I use transaction 'ME21', screen 121 for sample,
    the method using is Call Transation Using..)
    Step1: go to screen painter to display the screen 121, then we can count the fixed line on this screen, there is 7 lines above the steploop and 2 lines below the steploop, so there are total 9 fixed lines on this screen. This means except these 9 lines, all the other line is for step loop. Then have a look at steploop itselp, one entry of it will occupy two lines.
    (Be careful, for table control, the head and the bottom scroll bar will possess another two fixed lines, and there is a maximum number for table line)
    Now we have : FixedLine = 9
                  LoopLine  = 2(for table control, LoopLine is always equal to 1)
    Step2: go to transaction itself(ME21) to see how it roll page, in ME21, the first line of new page is always occupied by the last line of last page, so it begin with index '02', but in some other case, fisrt line is empty and ready for input.
    Now we have: FirstLine = 0
              or FirstLine = 1 ( in our case, FirstLine is 1 because the first line of new page is fulfilled)
    Step3: write a subroutine calcalculating number of pages
    (here, the name of actual parameter is the same as formal parameter)
    global data:    FixedLine type i, " number of fixed line on a certain screen
                    LoopLine  type i, " the number of lines occupied by one steploop item
                    FirstLine type i, " possbile value 0 or 1, 0 stand for the first line of new                                                               " scrolling screen is empty, otherwise is 1
                    Dataline  type i, " number of items you will use in BDC, using DESCRIBE to get
                    pageno    type i, " you need to scroll screen how many times.
                    line      type i, " number of lines appears on the screen.
                    index(2)  type N, " the screen index for certain item
                    begin     type i, " from parameter of loop
                    end       type i. " to parameter of loop
    *in code sample, the DataTable-linindex stands for the table index number of this line
    form calpage using FixedLine type i (see step 1)
                       LoopLine  type i (see step 1)
                       FirstLine type i (see step 2)
                       DataLine  type i ( this is the item number you will enter in transaction)
              changing pageno    type i (return the number of page, depends on run-time visible                                                                             line in table control/ Step Loop)
              changing line      type i.(visible lines one the screen)
    data: midd type i,
          vline type i, "visible lines
    if DataLine eq 0.
       Message eXXX.
    endif.
    vline = ( sy-srows - FixedLine ) div LoopLine.
    *for table control, you should compare vline with maximum line of
    *table control, then take the small one that is min(vline, maximum)
    *here only illustrate step loop
    if FirstLine eq 0.
            pageno = DataLine div vline.
            if pageno eq 0.
               pageno = pageno + 1.
            endif.
    elseif FirstLine eq 1.
            pageno = ( DataLine - 1 ) div ( vline - 1 ) + 1.
            midd = ( DataLine - 1 ) mod ( vline - 1).
            if midd = 0 and DataLine gt 1.
                    pageno = pageno - 1.
            endif.
    endif.
    line = vline.
    endform.
    Step4 write a subroutine to calculate the line index for each item.
    form calindex using Line type i (visible lines on the screen)
                        FirstLine type i(see step 2)
                        LineIndex type i(item index)
              changing  Index type n.    (index on the screen)
      if  FirstLine = 0.
            index = LineIndex mod Line.
            if index = '00'.
                    index = Line.
            endif.
      elseif FirstLine = 1.
            index = LineIndex mod ( Line - 1 ).
            if ( index between 1 and 0 ) and LineIndex gt 1.
                    index = index + Line - 1.
            endif.
            if Line = 2.
                    index = index + Line - 1.
            endif.
    endif.
    endform.
    Step5 write a subroutine to calculate the loop range.
    form calrange using Line type i ( visible lines on the screen)
                        DataLine type i
                        FirstLine type i
                        loopindex like sy-index
            changing    begin type i
                        end type i.
    If FirstLine = 0.
       if loopindex = 1.
            begin = 1.
            if DataLine <= Line.
                    end = DataLine.
            else.
                    end = Line.
            endif.
       elseif loopindex gt 1.
            begin = Line * ( loopindex - 1 ) + 1.
            end   = Line * loopindex.
            if end gt DataLine.
               end = DataLine.
            endif.
       endif.
    elseif FirstLine = 1.
      if loopindex = 1.
            begin = 1.
            if DataLine <= Line.
                    end = DataLine.
            else.
                    end = Line.
            endif.
      elseif loop index gt 1.
            begin = ( Line - 1 ) * ( loopindex - 1 ) + 2.
            end =   ( Line - 1 ) * ( loopindex - 1 ) + Line.
            if end gt DataLine.
                    end = DataLine.
            endif.
      endif.
    endif.
    endform.
    Step6 using field sysbol in your BDC, for example: in ME21, but you should calculate each item will correponding to which index in steploop/Table Control
    form creat_bdc.
    field-symbols: <material>, <quan>, <indicator>.
    data: name1(14) value 'EKPO-EMATN(XX)',
          name2(14) value 'EKPO-MENGE(XX)',
          name3(15) value 'RM06E-SELKZ(XX)'.
    assign:         name1 to <material>,
                    name2 to <quan>,
                    name3 to <indicator>.
    do pageno times.
    if sy-index gt 1
    *insert scroll page ok_code"
    endif.
            perform calrange using Line DataLine FirstLine sy-index
                             changing begin end.
    loop at DataTable from begin to end.
            perform calindex using Line FirstLine DataTable-LineIndex changing Index.
            name1+11(2) = Index.
            name2+11(2) = Index.
            name3+12(2) = Index.
            perform bdcfield using <material> DataTable-matnr.
            perform bdcfield using <quan>     DataTable-menge.
            perform bdcfield using <indicator> DataTable-indicator.
    endloop.
    enddo.
    Cheers
    VJ

  • Modpool Tabstrip control and Table control

    Hi All,
    pls mail me step by step procedure fo rmodule pool programming using Table control and Tabsrip.
    Thanks in Advance.

    hi,
    check the below links
    http://www.sapgenie.com/abap/example_code.htm
    http://www.sap-img.com/
    http://help.sap.com/saphelp_46c/helpdata/en/08/bef2dadb5311d1ad10080009b0fb56/content.htm
    http://www.sapgenie.com/links/abap.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/c9/5472fc787f11d194c90000e8353423/frameset.htm
    http://www.sapdevelopment.co.uk/dialog/dialoghome.htm
    check these links
    http://www.allsaplinks.com/dialog_programming.html
    http://sappoint.com/abap.html
    http://www.sap-img.com/abap.htm
    http://sap.ittoolbox.com/code/archives.asp?i=10&t=450&a=t
    http://www.sapdevelopment.co.uk/dialog/dialoghome.htm
    http://www.sap-img.com.
    http://www.sap-img.com/abap/
    http://sap.mis.cmich.edu/sap-abap/abap09/
    http://www.sapbrain.com/TUTORIALS/default.html
    steploops
    http://help.sap.com/saphelp_nw04/helpdata/en/d1/801c13454211d189710000e8322d00/content.htm
    http://sap.niraj.tripod.com/id28.html
    If you need further info on this shoot me a test mail to [email protected] i will farward the material to you
    If you find it useful mark the points
    Regards,
    Naveen

  • How to add a field and table control to BP transaction.

    Hi,
    I have a requirement to add a field and table control to the 'Control data' tab of the Transaction BP.
    Can some on please help me if having a solution and with any relavant documents.
    Thanks in advance.
    Raj & Khader.

    Also explore with EEWB tcode.
    Refer this threads
    Re: EEWB
    Created New fields in Business Activity with EEWB
    Cheers
    Manohar

  • If your Team Lead given Functional Specifications for a BDC program and you

    If your Team Lead given Functional Specifications for a BDC program and you need to decide wether to write a Method Call Transaction or a Session.
    How you will decide ?

    Hi Krishna,
    See this you will got some ideas.
    Diff b/w call transaction and session method is
    Call transaction.
    1) asynchronous processing
    2) can transfer small amount of data
    3) processing is faster.
    4) errors need to be handled explicitly
    5) data is updated automatically
    Session method.
    1) synchronous processing.
    2) can tranfer large amount of data.
    3) processing is slower.
    4) error log is created
    5) data is not updated until session is processed.
    Thanks,
    Reward If Helpful.

  • Difference between ALV and Table control

    Hi folks,
    i want to know the major differences between AlV and table controls.
    i know that table control is designed in screen painter, but i want to know the major diff between Table control and ALV.
    helpful answers will be rewarded.
    Regards,
    Naveen

    Hi Naveen,
    Basically ALV is a way to display the output and Table Control is designed in screen painter through which you can get entries in Table Control, can delete some records etc for further processing and  its not use only for Display.
    <b>ALV is Application List viewer:-</b>
    Sap provides a set of ALV (ABAP LIST VIEWER) function modules which can be put into use to embellish the output of a report. This set of ALV functions is used to enhance the readability and functionality of any report output. Cases arise in sap when the output of a report contains columns extending more than 255 characters in length. 
    In such cases, this set of ALV functions can help choose selected columns and arrange the different columns from a report output and also save different variants for report display. This is a very efficient tool for dynamically sorting and arranging the columns from a report output. 
    <b>TABLE CONTROL:-</b>
    ABAP offers two mechanisms for displaying and using table data in a screen. These mechanisms are table controls and step loops. Table controls and step loops are types of screen tables you can add to a screen in the Screen Painter.
    Rewards if useful.
    Regards,
    Shilpi

  • Dynamic tabstrips and table control in custom infotype

    Dear Experts,
    I have a requirement to create a custom infotype using tabstrips and table control. The tabstripes should also be dynamically populated. For example we have infty 8(Basic pay) used table control and 24(Qualifications) for tabstripes.
    Could you please tell me how to do this. Please do the needful ASAP.
    Thanks,
    Chaitanya.
    Moderator message - Please don't just post your requirements and ask the forum to do your work for you...especially ASAP - Thread locked
    Edited by: Rob Burbank on Oct 7, 2009 4:16 PM

    Hi Partha,
    Pls check the threads:
    Best way to store a table control into an infotype
    Re: Custom Infotype with table control - Overview/List  Screen
    Dilek

  • Query on ABAP List Viewer and Table Control?

    Hi all,
    I was trying to solve the exercises in these areas....but was unable to do as some of the concepts were not clear to me as I'm new to this field.
    So Can any one help me out in giving me the Notes or attachments on the ABAP List Viewer(A.L.V.) and Table Control.
    My ID: [email protected]
    Waiting for a reply...
    A New Entrant in ABAP.
    Message was edited by:
            saikumar b

    Hi saikumar,
    I just start to work with Abap too. All links i Know:
    http://www.erpgenie.com/abap/controls/alvgrid.htm
    http://www.abapfans.hpg.ig.com.br/links.htm
    http://abap4.tripod.com/index..html
    http://paginas.terra.com.br/educacao/abap/
    http://www.sdn.sap.com/
    http://www.sap-img.com/
    http://www.planetsap.com/Tips_and_Tricks.htm
    http://www.abap4.com.br/
    http://www.erpgenie.com/sap/abap/index.htm
    Good lucky

  • Last access to programs and tables

    Hello,
    I need to discover the last time some programs and tables were used...
    We believe that some objects are no longer used and maybe we could delete them.
    How could I have this kind of historic use of programs and tables ?
    Eduardo

    Without additional software this is not possible, not every call to a program or to a table is logged, your database would be full if that'd be done.
    Markus

  • How can i log transaction codes, programes and tables used by a user?

    Hi everyone,
    i need to log transaction codes, programes and tables a user has used in a certain time. how can i trace that and is it possible with timestamps?
    i tried something with the badi workload_statistic but thats not what i need. is there a simple function which can do that or is this really much more complicated?

    In SE13 there is an option to log table changes for a table.
    If you search for "SCU3" you will find plenty of information on this. Also search for "RECCLIENT" (without the "/") and you will find some more specialized threads.
    Cheers,
    Julius

  • Alv Grid and Table Control

    What is the difference between Alv Grid and Table Control?Explain in detail..

    Table control is a screen table to display table data in a screen. You can add table control to a screen in the Screen Painter. The typical flow-logic to process table control is:
    LOOP AT <internal table> CURSOR <scroll-var>
    [WITH CONTROL <table-control> ]
    [FROM <line1> ] [TO <line2> ].
    ...<actions>...
    ENDLOOP.
    ALV Grid is a SAP Technology to display a set of data on the output screen. For example if you have selected some SAP tables and processed these data in a way you want to display, then you can pass the internal table to the ALV Grid and it will be displayed on the result screen as ALV Grid. See example in SE16 result.

  • BDC- Inconsistancy in table control for t-code MR21

    Hi all,
    We are facing inconsistency in the table control (number of line items) for t-code MR21 in normal transaction screen and BDC screen.
    In normal transaction run (MR21) we can see 12 line entries.
    But for the same t-code while processing of a session created by BDC recording we can see only 9 entries.
    Because of the mismatch in the lines, there will be a gap of 3 blank lines.
    Kindly provide any input to solve the issue.
    Thanks & Regards,
    Prabhu

    Hello,
    You will have to use the OPTIONS addition of CALL TRANSACTION to set the default screen size
    data: t_ctu type ctu_params.
    t_ctu-defsize = 'X'.
    t_ctu-dismode = 'N' .   " Mode
    t_ctu-upmode = 'S'  " Update
    call transaction 'MR21' using bdcdata options form t_ctu messages into t_messages.
    Vikranth

  • MODULE POOLL  PROGRAMING WITH TABLE CONTROL

    hi all,
    in table control update, edit, delete
    please give me the solution
    in pai
    where i can write
    module
    regards

    *&  Include           ZPPCONFI01
    *&      Module  USER_COMMAND_9100  INPUT
          text
    module USER_COMMAND_9100 input.
    CASE OK_CODE.
    WHEN 'FCAST'.
    *&& CASTING
    if sy-uname = 'PTEAM' .
    CALL SCREEN 9200.
    else.
    message 'No Autorization' type 'I'.
    endif.
    CLEAR OK_CODE.
    *&& INSPECTION
    WHEN 'FINSP'.
    if sy-uname = 'PTEAM' .
    CALL SCREEN 9300.
    else.
    message 'No Autorization' type 'I'.
    endif.
    CLEAR OK_CODE.
    WHEN 'FGLAZ'.
    if sy-uname = 'PTEAM' .
    CALL SCREEN 9400.
    else.
    message 'No Autorization' type 'I'.
    endif.
    CLEAR OK_CODE.
    WHEN 'FMOUL'.
    if sy-uname = 'PTEAM' .
    CALL SCREEN 9500.
    else.
    message 'No Autorization' type 'I'.
    endif.
    CLEAR OK_CODE.
    when 'BACK'.
    CLEAR : I_TAB, I_TAB1.
    REFRESH : I_TAB1.
    leave program.
    ENDCASE.
    endmodule.                 " USER_COMMAND_9100  INPUT
    *&      Module  USER_COMMAND_9200  INPUT
          text
    module USER_COMMAND_9200 input.
    CASE OK_CODE1.
      WHEN 'GO'.
    *ROUTINE GETDATA
       PERFORM GETDATA.
       CLEAR OK_CODE1.
    *&& BACK
    when 'CANCEL'.
        leave program.
      WHEN 'BACK'.
       CLEAR : I_TAB, I_TAB1,AFKO-PLNBEZ,ZMATKL,T001W-WERKS,AFKO-GSTRP,flag,count,qtyflag.
       REFRESH : I_TAB1.
       LEAVE TO SCREEN 9100.
    *&& SAVE   INSERT DATA TO ZPPT_CONFIRM
      WHEN 'SAVE'.
        data : co type C,
               del type c.
      LOOP AT I_TAB1.
      IF I_TAB1-LMNGA  IS NOT INITIAL OR
         I_TAB1-LMNGA1 IS NOT INITIAL. "OR
        I_TAB1-XMNGA  IS NOT INITIAL.
            if I_TAB1-EMPNO <> space and I_TAB1-EMPNO+0(1) <> 'P'.
             MESSAGE I991(ZMESSAGE) with 'ENTER INSPECTOR NUMBER at Line' sy-tabix.
              continue.
            endif.
            clear : v_charg.
                        SELECT single CHARG FROM MCHB into v_charg
                                    WHERE LGORT = '1080'
                                      AND LVORM <> 'X'
                                      AND CHARG = I_TAB1-CHARG.
                    if sy-subrc <> 0.
                    Message 'Enter correct batch' type 'W'.
                    continue.
                    endif.
         IF I_TAB1-LMNGA IS NOT INITIAL AND
            I_TAB1-CHARG IS INITIAL.
            MESSAGE 'Enter Batch' TYPE 'S'.
         ELSE.
    *&& ACTIVITY 10
       ZPPT_CONFIRM-CDATE  = SY-DATUM.
       ZPPT_CONFIRM-CTIME  = SY-UZEIT.
       ZPPT_CONFIRM-PDATE  = afko-gstrp.
       ZPPT_CONFIRM-WERKS  = T001W-WERKS.
       ZPPT_CONFIRM-DISPO  = '103'.            "MRP CONTROLLER
       ZPPT_CONFIRM-VORNR  = '0010'.
       ZPPT_CONFIRM-AUFNR  = I_TAB1-AUFNR.     "ORDER NO
       ZPPT_CONFIRM-ZSUPNO = ZPP_SUP_MRP-ZSUPNO.
       ZPPT_CONFIRM-AUFART = 'ZH23'.          "ORDER TYPE
       ZPPT_CONFIRM-MATNR  = I_TAB1-PLNBEZ.   "MATERIAL
       ZPPT_CONFIRM-MAKTX  = I_TAB1-WGBEZ.
       ZPPT_CONFIRM-GAMNG  = I_TAB1-GAMNG.
       ZPPT_CONFIRM-LMNGA  = I_TAB1-LMNGA.    "MOULD FILL
      ZPPT_CONFIRM-GRUND     = I_TAB1-GRUND. "reason for scrap
       ZPPT_CONFIRM-ZSUPNAME  = SNAME.        "supervioser name
       ZPPT_CONFIRM-CHARG     = I_TAB1-CHARG. "batch
       ZPPT_CONFIRM-ZHODNO    = V_ZHODNO.
       ZPPT_CONFIRM-FEVOR     = V_PRDSCHED.    "PRODUCT SCHEDULER
       ZPPT_CONFIRM-PERNR     = I_TAB1-pernr.
       ZPPT_CONFIRM-ENAME     = I_TAB1-ENAME.
       ZPPT_CONFIRM-ZUSER     = sy-uname.
       sno = sno + 1.
       ZPPT_CONFIRM-sno     = sno.
       INSERT ZPPT_CONFIRM.
       CLEAR  ZPPT_CONFIRM.
    *&& ACTIVITY 20
       if I_TAB1-XMNGA1 <> space.
       ZPPT_CONFIRM-CDATE  = SY-DATUM.
       ZPPT_CONFIRM-CTIME  = SY-UZEIT.
       ZPPT_CONFIRM-PDATE  = afko-gstrp.
       ZPPT_CONFIRM-WERKS  = T001W-WERKS.
       ZPPT_CONFIRM-DISPO  = '103'.
       ZPPT_CONFIRM-VORNR  = '0020'.
       ZPPT_CONFIRM-AUFNR  = I_TAB1-AUFNR.
       ZPPT_CONFIRM-ZSUPNO = ZPP_SUP_MRP-ZSUPNO.
       ZPPT_CONFIRM-AUFART = 'ZH23'.
       ZPPT_CONFIRM-MATNR  = I_TAB1-PLNBEZ.
       ZPPT_CONFIRM-MAKTX  = I_TAB1-WGBEZ.
       ZPPT_CONFIRM-GAMNG  = I_TAB1-GAMNG.
       ZPPT_CONFIRM-XMNGA  = I_TAB1-XMNGA1.   "SCARP
         if I_TAB1-XMNGA1 is NOT INITIAL.
       ZPPT_CONFIRM-LMNGA  = I_TAB1-LMNGA1.  "CARRYOUT
       ZPPT_CONFIRM-GRUND     = '0001'. "reason for scrap
         CO = 'X'.
         endif.
       ZPPT_CONFIRM-ZSUPNAME  = SNAME.
      ZPPT_CONFIRM-CHARG     = I_TAB1-CHARG.
       ZPPT_CONFIRM-ZHODNO    = V_ZHODNO.
       ZPPT_CONFIRM-FEVOR     = V_PRDSCHED.
       ZPPT_CONFIRM-PERNR     = I_TAB1-pernr.
       ZPPT_CONFIRM-ENAME     = I_TAB1-ENAME.
       ZPPT_CONFIRM-ZUSER     = sy-uname.
       sno = sno + 1.
       ZPPT_CONFIRM-sno     = sno.
       INSERT ZPPT_CONFIRM.
       CLEAR  ZPPT_CONFIRM.
       endif.
       if I_TAB1-XMNGA2 <> space.
       ZPPT_CONFIRM-CDATE  = SY-DATUM.
       ZPPT_CONFIRM-CTIME  = SY-UZEIT.
       ZPPT_CONFIRM-PDATE  = afko-gstrp.
       ZPPT_CONFIRM-WERKS  = T001W-WERKS.
       ZPPT_CONFIRM-DISPO  = '103'.
       ZPPT_CONFIRM-VORNR  = '0020'.
       ZPPT_CONFIRM-AUFNR  = I_TAB1-AUFNR.
       ZPPT_CONFIRM-ZSUPNO = ZPP_SUP_MRP-ZSUPNO.
       ZPPT_CONFIRM-AUFART = 'ZH23'.
       ZPPT_CONFIRM-MATNR  = I_TAB1-PLNBEZ.
       ZPPT_CONFIRM-MAKTX  = I_TAB1-WGBEZ.
       ZPPT_CONFIRM-GAMNG  = I_TAB1-GAMNG.
      ZPPT_CONFIRM-LMNGA  = I_TAB1-LMNGA1.  "CARRYOUT
       ZPPT_CONFIRM-XMNGA  = I_TAB1-XMNGA2.   "SCARP
         if I_TAB1-XMNGA2 is NOT INITIAL.
         ZPPT_CONFIRM-GRUND     = '0002'. "reason for scrap
         if co <> 'X'.
          ZPPT_CONFIRM-LMNGA  = I_TAB1-LMNGA1.  "CARRYOUT
          co = 'X'.
         endif.
         endif.
       ZPPT_CONFIRM-ZSUPNAME  = SNAME.
      ZPPT_CONFIRM-CHARG     = I_TAB1-CHARG.
       ZPPT_CONFIRM-ZHODNO    = V_ZHODNO.
       ZPPT_CONFIRM-FEVOR     = V_PRDSCHED.
       ZPPT_CONFIRM-PERNR     = I_TAB1-pernr.
       ZPPT_CONFIRM-ENAME     = I_TAB1-ENAME.
       ZPPT_CONFIRM-ZUSER     = sy-uname.
       sno = sno + 1.
       ZPPT_CONFIRM-sno     = sno.
       INSERT ZPPT_CONFIRM.
       CLEAR  ZPPT_CONFIRM.
       endif.
       if I_TAB1-XMNGA3 <> space.
       ZPPT_CONFIRM-CDATE  = SY-DATUM.
       ZPPT_CONFIRM-CTIME  = SY-UZEIT.
       ZPPT_CONFIRM-PDATE  = afko-gstrp.
       ZPPT_CONFIRM-WERKS  = T001W-WERKS.
       ZPPT_CONFIRM-DISPO  = '103'.
       ZPPT_CONFIRM-VORNR  = '0020'.
       ZPPT_CONFIRM-AUFNR  = I_TAB1-AUFNR.
       ZPPT_CONFIRM-ZSUPNO = ZPP_SUP_MRP-ZSUPNO.
       ZPPT_CONFIRM-AUFART = 'ZH23'.
       ZPPT_CONFIRM-MATNR  = I_TAB1-PLNBEZ.
       ZPPT_CONFIRM-MAKTX  = I_TAB1-WGBEZ.
       ZPPT_CONFIRM-GAMNG  = I_TAB1-GAMNG.
      ZPPT_CONFIRM-LMNGA  = I_TAB1-LMNGA1.  "CARRYOUT
       ZPPT_CONFIRM-XMNGA  = I_TAB1-XMNGA3.   "SCARP
         if I_TAB1-XMNGA3 is NOT INITIAL.
       ZPPT_CONFIRM-GRUND     = '0003'. "reason for scrap
         if co <> 'X'.
          ZPPT_CONFIRM-LMNGA  = I_TAB1-LMNGA1.  "CARRYOUT
          co = 'X'.
         endif.
         endif.
       ZPPT_CONFIRM-ZSUPNAME  = SNAME.
      ZPPT_CONFIRM-CHARG     = I_TAB1-CHARG.
       ZPPT_CONFIRM-ZHODNO    = V_ZHODNO.
       ZPPT_CONFIRM-FEVOR     = V_PRDSCHED.
       ZPPT_CONFIRM-PERNR     = I_TAB1-pernr.
       ZPPT_CONFIRM-ENAME     = I_TAB1-ENAME.
       ZPPT_CONFIRM-ZUSER     = sy-uname.
       sno = sno + 1.
       ZPPT_CONFIRM-sno     = sno.
       INSERT ZPPT_CONFIRM.
       CLEAR  ZPPT_CONFIRM.
       endif.
       if I_TAB1-XMNGA4 <> space.
       ZPPT_CONFIRM-CDATE  = SY-DATUM.
       ZPPT_CONFIRM-CTIME  = SY-UZEIT.
       ZPPT_CONFIRM-PDATE  = afko-gstrp.
       ZPPT_CONFIRM-WERKS  = T001W-WERKS.
       ZPPT_CONFIRM-DISPO  = '103'.
       ZPPT_CONFIRM-VORNR  = '0020'.
       ZPPT_CONFIRM-AUFNR  = I_TAB1-AUFNR.
       ZPPT_CONFIRM-ZSUPNO = ZPP_SUP_MRP-ZSUPNO.
       ZPPT_CONFIRM-AUFART = 'ZH23'.
       ZPPT_CONFIRM-MATNR  = I_TAB1-PLNBEZ.
       ZPPT_CONFIRM-MAKTX  = I_TAB1-WGBEZ.
       ZPPT_CONFIRM-GAMNG  = I_TAB1-GAMNG.
      ZPPT_CONFIRM-LMNGA  = I_TAB1-LMNGA1.  "CARRYOUT
       ZPPT_CONFIRM-XMNGA  = I_TAB1-XMNGA4.   "SCARP
         if I_TAB1-XMNGA4 is NOT INITIAL.
       ZPPT_CONFIRM-GRUND     = '0004'. "reason for scrap
         if co <> 'X'.
          ZPPT_CONFIRM-LMNGA  = I_TAB1-LMNGA1.  "CARRYOUT
          co = 'X'.
         endif.
         endif.
       ZPPT_CONFIRM-ZSUPNAME  = SNAME.
      ZPPT_CONFIRM-CHARG     = I_TAB1-CHARG.
       ZPPT_CONFIRM-ZHODNO    = V_ZHODNO.
       ZPPT_CONFIRM-FEVOR     = V_PRDSCHED.
       ZPPT_CONFIRM-PERNR     = I_TAB1-pernr.
       ZPPT_CONFIRM-ENAME     = I_TAB1-ENAME.
       ZPPT_CONFIRM-ZUSER     = sy-uname.
       sno = sno + 1.
       ZPPT_CONFIRM-sno     = sno.
       INSERT ZPPT_CONFIRM.
       CLEAR  ZPPT_CONFIRM.
       endif.
       IF SY-SUBRC = 0.
          DELETE TABLE I_TAB1 FROM I_TAB1.
       ENDIF.
       CLEAR  ZPPT_CONFIRM.
      ENDIF.
      ENDIF.
      ENDLOOP.
      CLEAR OK_CODE1.
    ENDCASE.
    endmodule.                 " USER_COMMAND_9200  INPUT
    *&      Form  GETDATA
          text
    -->  p1        text
    <--  p2        text
    form GETDATA .
    refresh i_tab1.
          V_DATE = AFKO-GSTRP.
      SELECT SINGLE FEVOR ZHODNO FROM ZPP_SUP_MRP  INTO (V_PRDSCHED, V_ZHODNO)
                          WHERE ZSUPNO = ZPP_SUP_MRP-ZSUPNO.
        if sy-subrc = 0.
            CALL FUNCTION 'HR_JP_MONTH_BEGIN_END_DATE'
              EXPORTING
                iv_date                   = V_DATE
             IMPORTING
               EV_MONTH_BEGIN_DATE       = sdate
               EV_MONTH_END_DATE         = edate.
            SELECT SINGLE ENAME FROM PA0001 INTO SNAME WHERE PERNR = ZPP_SUP_MRP-ZSUPNO
                                                         AND ENDDA  = '99991231'.
          IF AFKO-PLNBEZ IS NOT INITIAL.
            select A~AUFNR
                   A~PLNBEZ
                   A~GAMNG
                   INTO corresponding fields of TABLE I_TAB1
                   FROM  AFKO AS A
                   JOIN  AFPO AS B ON
                         AAUFNR = BAUFNR
                   JOIN  AUFK AS C ON
                         AAUFNR = CAUFNR
                   JOIN  JEST AS D ON
                         COBJNR = DOBJNR
                   WHERE A~FEVOR = V_PRDSCHED
                     AND A~PLNBEZ = AFKO-PLNBEZ
                     AND A~DISPO = '103'
                     AND A~GLTRP between sdate and edate
                     AND B~DAUAT = 'ZH23'
                     AND B~PWERK = T001W-WERKS
                     AND D~STAT  = 'I0002'
                     AND D~INACT <> 'X'.
            IF SY-SUBRC = 0.
              ccontrol-lines = sy-dbcnt.
              LOOP AT I_TAB1.
                SELECT SINGLE WGBEZ FROM T023T INTO I_TAB1-WGBEZ
                                   WHERE MATKL = I_TAB1-PLNBEZ+0(7)
                                     AND SPRAS = 'E'.
                 IF SY-SUBRC = 0.
                    MODIFY I_TAB1 FROM I_TAB1.
                    CLEAR I_TAB1.
                 ENDIF.
              ENDLOOP.
            ENDIF.
          ELSE.
            select A~AUFNR
                   A~PLNBEZ
                   A~GAMNG
                   INTO corresponding fields of TABLE I_TAB1
                   FROM  AFKO AS A
                   JOIN  AFPO AS B ON
                         AAUFNR = BAUFNR
                   JOIN  AUFK AS C ON
                         AAUFNR = CAUFNR
                   JOIN  JEST AS D ON
                         COBJNR = DOBJNR
                   WHERE A~FEVOR = V_PRDSCHED
                     AND A~DISPO = '103'
                     AND A~GLTRP between sdate and edate
                     AND B~DAUAT = 'ZH23'
                     AND B~PWERK = T001W-WERKS
                     AND D~STAT  = 'I0002'
                     AND D~INACT <> 'X'.
            IF SY-SUBRC = 0.
              ccontrol-lines = sy-dbcnt.
              LOOP AT I_TAB1.
                SELECT SINGLE WGBEZ FROM T023T INTO I_TAB1-WGBEZ
                                   WHERE MATKL = I_TAB1-PLNBEZ+0(7)
                                     AND SPRAS = 'E'.
                 IF SY-SUBRC = 0.
                    MODIFY I_TAB1 FROM I_TAB1.
                    CLEAR I_TAB1.
                 ENDIF.
              ENDLOOP.
            ENDIF.
            ENDIF.
            endif.
    sort i_tab1 by plnbez.
    endform.                    " GETDATA
    *&      Module  F4HELPONCHARG  INPUT
          text
    module F4HELPONCHARG input.
    CLEAR : V_MATNR, V_STEPL, V_STLNR, V_IDNRK.
    CLEAR : C_TOPLINE.
    C_TOPLINE = CCONTROL-TOP_LINE - 1.
    CALL FUNCTION 'DYNP_GET_STEPL'
    IMPORTING
       POVSTEPL              = v_stepl
    EXCEPTIONS
       STEPL_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.
    ENDIF.
    v_stepl = v_stepl +  C_TOPLINE.
    READ TABLE I_TAB1 INDEX v_stepl.
    IF SY-SUBRC = 0.
    SELECT SINGLE STLNR FROM AFKO INTO V_STLNR
                       WHERE AUFNR = I_TAB1-AUFNR.
           IF SY-SUBRC = 0.
              V_MATNR = I_TAB1-PLNBEZ+0(7).
              CONCATENATE V_MATNR '%' INTO V_MATNR.
              SELECT SINGLE IDNRK FROM STPO INTO V_IDNRK
                                 WHERE STLNR = V_STLNR
                                   AND IDNRK LIKE V_MATNR.
                     IF SY-SUBRC = 0.
                        SELECT CHARG FROM MCHB INTO TABLE I_BATCH
                                    WHERE MATNR LIKE V_IDNRK
                                      AND LGORT = '1080'
                                      AND WERKS = T001W-WERKS
                                      AND LVORM <> 'X'.
                     ENDIF.
           ENDIF.
    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
      EXPORTING
      DDIC_STRUCTURE         = ' '
        retfield               = 'I_TAB-CHARG'
      PVALKEY                = ' '
       DYNPPROG               = SY-REPID
       DYNPNR                 = SY-DYNNR
       DYNPROFIELD            = 'CHARG'
      STEPL                  = 0
       WINDOW_TITLE           = 'BATCH'
      VALUE                  = ' '
       VALUE_ORG              = 'S'
      MULTIPLE_CHOICE        = ' '
      DISPLAY                = ' '
      CALLBACK_PROGRAM       = ' '
      CALLBACK_FORM          = ' '
      MARK_TAB               =
    IMPORTING
      USER_RESET             =
      tables
        value_tab              = I_BATCH
      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.
    ENDIF.
    endmodule.                 " F4HELPONCHARG  INPUT
    *&      Module  F4HELPONGRUND  INPUT
          text
    module F4HELPONGRUND input.
    SELECT GRUND GRDTX FROM TRUGT
                       INTO CORRESPONDING FIELDS OF TABLE I_TRUG
                      WHERE WERKS = T001W-WERKS
                        AND SPRAS = 'E'.
    IF SY-SUBRC = 0.
    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
      EXPORTING
      DDIC_STRUCTURE         = ' '
        retfield               = 'I_TAB-GRUND'
      PVALKEY                = ' '
       DYNPPROG               = SY-REPID
       DYNPNR                 = SY-DYNNR
       DYNPROFIELD            = 'GRUND'
      STEPL                  = 1
       WINDOW_TITLE           = 'Variance'
      VALUE                  = ' '
        VALUE_ORG              = 'S'
      MULTIPLE_CHOICE        = ' '
      DISPLAY                = ' '
      CALLBACK_PROGRAM       = ' '
      CALLBACK_FORM          = ' '
      MARK_TAB               =
    IMPORTING
      USER_RESET             =
      tables
        value_tab              = I_TRUG
      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.
    ENDIF.
    endmodule.                 " F4HELPONGRUND  INPUT
    *&      Module  MOVE_DATA_TO_INTERNALTAB  INPUT
          text
    module MOVE_DATA_TO_INTERNALTAB input.
    CLEAR I_TAB1.
    CLEAR ZWERKS_HR.
    IF T001W-WERKS = '1102'.
    ZWERKS_HR = '1200'.
    ENDIF.
           if I_TAB-EMPNO <> space and I_TAB-EMPNO+0(1) <> 'P'.
             MESSAGE I991(ZMESSAGE) with 'ENTER POTTER NUMBER'.
    ***BREAK-POINT.
             FLAG = 'X'.
             COUNT = ( CCONTROL-CURRENT_LINE - CCONTROL-Top_line ) + 1.
             continue.
           endif.
    IF I_TAB-EMPNO IS NOT INITIAL.
      SELECT SINGLE ENAME FROM PA0001 INTO I_TAB-ENAME
                         WHERE PERNR = I_TAB-EMPNO.
         SELECT SINGLE A~ENAME
                       A~PERNR
               A~WERKS
               B~USRID
                 INTO CORRESPONDING FIELDS OF TABLE I_FINAL
                  INTO (I_TAB-ENAME,I_TAB-pernr)
                  FROM PA0001 AS A
                  JOIN PA0105 AS B ON APERNR = BPERNR
                 WHERE B~USRID <> SPACE
                   AND B~USRID = I_TAB-EMPNO
                   AND A~endda = '99991231'
                   AND A~WERKS = ZWERKS_HR
                   AND ( B~SUBTY = 'POTT' OR
                       B~SUBTY = 'INSP' OR
                       B~SUBTY = 'GLAZ' OR
                       B~SUBTY = 'STOP' OR
                       B~SUBTY = 'SORT' ).
                       IF SY-SUBRC <> 0.
                       clear : I_TAB-ENAME,I_TAB-pernr.
                       ENDIF.
    ENDIF.
    MOVE-CORRESPONDING I_TAB TO I_TAB1.
    MODIFY I_TAB1 FROM I_TAB1 INDEX CCONTROL-CURRENT_LINE.
    endmodule.                 " MOVE_DATA_TO_INTERNALTAB  INPUT
    *&      Module  USER_COMMAND_9300  INPUT
          text
    module USER_COMMAND_9300 input.
    CASE OK_CODE2.
    *&& GET DATA FOR INSPECTION
    WHEN 'GO'.
    PERFORM GETINSDATA.
    CLEAR OK_CODE2.
    *&& BACK
      WHEN 'BACK'.
       CLEAR : I_TAB, I_TAB1,AFKO-PLNBEZ,ZMATKL,T001W-WERKS,
               AFKO-GSTRP,PA0105-USRID,FLAG,COUNT,COUNT1.
       REFRESH : I_TAB1.
       LEAVE TO SCREEN 9100.
    *&& SAVE   INSERT DATA TO ZPPT_CONFIRM
      WHEN 'SAVE'.
      LOOP AT I_TAB1.
      IF I_TAB1-LMNGA  IS NOT INITIAL OR
         I_TAB1-XMNGA  IS NOT INITIAL.
           if I_TAB1-EMPNO <> space and I_TAB1-EMPNO+0(1) <> 'I'.
             MESSAGE I991(ZMESSAGE) with 'ENTER INSPECTOR NUMBER at Line' sy-tabix.
             continue.
           endif.
    *&& ACTIVITY 10
       ZPPT_CONFIRM-CDATE  = SY-DATUM.
       ZPPT_CONFIRM-CTIME  = SY-UZEIT.
       ZPPT_CONFIRM-PDATE  = afko-gstrp.
       ZPPT_CONFIRM-WERKS  = T001W-WERKS.
       ZPPT_CONFIRM-DISPO  = '110'.            "MRP CONTROLLER
       ZPPT_CONFIRM-VORNR  = '0010'.
       ZPPT_CONFIRM-AUFNR  = I_TAB1-AUFNR.     "ORDER NO
       ZPPT_CONFIRM-ZSUPNO = ZPP_SUP_MRP-ZSUPNO.
       ZPPT_CONFIRM-AUFART = 'ZH24'.          "ORDER TYPE
       ZPPT_CONFIRM-MATNR  = I_TAB1-PLNBEZ.   "MATERIAL
       ZPPT_CONFIRM-MAKTX  = I_TAB1-WGBEZ.
       ZPPT_CONFIRM-GAMNG  = I_TAB1-GAMNG.
       ZPPT_CONFIRM-rcpts  = I_TAB1-rcpts.
       ZPPT_CONFIRM-LMNGA  = I_TAB1-LMNGA.    "MOULD FILL
       ZPPT_CONFIRM-XMNGA  = I_TAB1-XMNGA.    "SCRAP
         if I_TAB1-XMNGA is NOT INITIAL.
       ZPPT_CONFIRM-GRUND     = I_TAB1-GRUND. "reason for scrap
         endif.
       ZPPT_CONFIRM-ZSUPNAME  = SNAME.        "supervioser name
       ZPPT_CONFIRM-ZHODNO    = V_ZHODNO.
       ZPPT_CONFIRM-FEVOR     = V_PRDSCHED.    "PRODUCT SCHEDULER
       ZPPT_CONFIRM-PERNR     = I_TAB1-pernr.
       ZPPT_CONFIRM-ENAME     = I_TAB1-ENAME.
       ZPPT_CONFIRM-ZUSER     = sy-uname.
       INSERT ZPPT_CONFIRM.
       IF SY-SUBRC = 0.
          DELETE TABLE I_TAB1 FROM I_TAB1.
       ENDIF.
       CLEAR  ZPPT_CONFIRM.
      ENDIF.
      ENDLOOP.
    CLEAR : OK_CODE2.
    ENDCASE.
    endmodule.                 " USER_COMMAND_9300  INPUT
    *&      Form  GETINSDATA
          text
    -->  p1        text
    <--  p2        text
    form GETINSDATA .
    refresh i_tab1.
          V_DATE = AFKO-GSTRP.
    SELECT SINGLE FEVOR ZHODNO FROM ZPP_SUP_MRP  INTO (V_PRDSCHED, V_ZHODNO)
                         WHERE ZSUPNO = ZPP_SUP_MRP-ZSUPNO.
       if sy-subrc = 0.
            CALL FUNCTION 'HR_JP_MONTH_BEGIN_END_DATE'
              EXPORTING
                iv_date                   = V_DATE
             IMPORTING
               EV_MONTH_BEGIN_DATE       = sdate
               EV_MONTH_END_DATE         = edate.
           SELECT SINGLE ENAME FROM PA0001 INTO SNAME WHERE PERNR = ZPP_SUP_MRP-ZSUPNO
                                                        AND ENDDA  = '99991231'.
           IF AFKO-PLNBEZ IS NOT INITIAL.
            select A~AUFNR
                   A~PLNBEZ
                   A~GAMNG
                   INTO corresponding fields of TABLE I_TAB1
                   FROM  AFKO AS A
                   JOIN  AFPO AS B ON
                         AAUFNR = BAUFNR
                   JOIN  AUFK AS C ON
                         AAUFNR = CAUFNR
                   JOIN  JEST AS D ON
                         COBJNR = DOBJNR
                   WHERE
                         A~PLNBEZ = AFKO-PLNBEZ
                     AND A~DISPO = '110'
                     AND A~GLTRP between sdate and edate
                     AND B~DAUAT = 'ZH24'
                     AND B~PWERK = T001W-WERKS
                     AND D~STAT  = 'I0002'
                     AND D~INACT <> 'X'.
            IF SY-SUBRC = 0.
              icontrol-lines = sy-dbcnt.
              LOOP AT I_TAB1.
                SELECT SINGLE WGBEZ FROM T023T INTO I_TAB1-WGBEZ
                                   WHERE MATKL = I_TAB1-PLNBEZ+0(7)
                                     AND SPRAS = 'E'.
                 IF SY-SUBRC = 0.
                    MODIFY I_TAB1 FROM I_TAB1.
                    CLEAR I_TAB1.
                 ENDIF.
              ENDLOOP.
            ENDIF.
          ELSE.
            select A~AUFNR
                   A~PLNBEZ
                   A~GAMNG
                   INTO corresponding fields of TABLE I_TAB1
                   FROM  AFKO AS A
                   JOIN  AFPO AS B ON
                         AAUFNR = BAUFNR
                   JOIN  AUFK AS C ON
                         AAUFNR = CAUFNR
                   JOIN  JEST AS D ON
                         COBJNR = DOBJNR
                   WHERE
                  A~FEVOR = V_PRDSCHED
                         A~DISPO = '110'
                     AND A~GLTRP between sdate and edate
                     AND B~DAUAT = 'ZH24'
                     AND B~PWERK = T001W-WERKS
                     AND D~STAT  = 'I0002'
                     AND D~INACT <> 'X'.
            IF SY-SUBRC = 0.
              icontrol-lines = sy-dbcnt.
              LOOP AT I_TAB1.
                SELECT SINGLE WGBEZ FROM T023T INTO I_TAB1-WGBEZ
                                   WHERE MATKL = I_TAB1-PLNBEZ+0(7)
                                     AND SPRAS = 'E'.
                 IF SY-SUBRC = 0.
                    MODIFY I_TAB1 FROM I_TAB1.
                    CLEAR I_TAB1.
                 ENDIF.
              ENDLOOP.
            ENDIF.
          ENDIF.
           endif.
    sort i_tab1 by plnbez.
    endform.                    " GETINSDATA
    *&      Module  USER_COMMAND_9400  INPUT
          text
    module USER_COMMAND_9400 input.
    CASE OK_CODE3.
    *&& GET DATA FOR INSPECTION
    WHEN 'GO'.
    PERFORM GETGLADATA.
    CLEAR OK_CODE3.
    *&& BACK
      WHEN 'BACK'.
       CLEAR : I_TAB, I_TAB1,AFKO-PLNBEZ,ZMATKL,T001W-WERKS,
               AFKO-GSTRP,PA0105-USRID,flag,count.
       REFRESH : I_TAB1.
       LEAVE TO SCREEN 9100.
    *&& SAVE   INSERT DATA TO ZPPT_CONFIRM
      WHEN 'SAVE'.
      LOOP AT I_TAB1.
      IF I_TAB1-LMNGA  IS NOT INITIAL OR
         I_TAB1-XMNGA  IS NOT INITIAL.
           if I_TAB1-EMPNO <> space and I_TAB1-EMPNO+0(1) <> 'G'.
             MESSAGE I991(ZMESSAGE) with 'ENTER GLAZER NUMBER at Line' sy-tabix.
             continue.
           endif.
    *&& ACTIVITY 10
       ZPPT_CONFIRM-CDATE  = SY-DATUM.
       ZPPT_CONFIRM-CTIME  = SY-UZEIT.
       ZPPT_CONFIRM-PDATE  = afko-gstrp.
       ZPPT_CONFIRM-WERKS  = T001W-WERKS.
       ZPPT_CONFIRM-DISPO  = '104'.            "MRP CONTROLLER
       ZPPT_CONFIRM-VORNR  = '0010'.
       ZPPT_CONFIRM-AUFNR  = I_TAB1-AUFNR.     "ORDER NO
       ZPPT_CONFIRM-ZSUPNO = ZPP_SUP_MRP-ZSUPNO.
       ZPPT_CONFIRM-AUFART = 'ZH24'.          "ORDER TYPE
       ZPPT_CONFIRM-MATNR  = I_TAB1-PLNBEZ.   "MATERIAL
       ZPPT_CONFIRM-MAKTX  = I_TAB1-WGBEZ.
       ZPPT_CONFIRM-GAMNG  = I_TAB1-GAMNG.
       ZPPT_CONFIRM-LMNGA  = I_TAB1-LMNGA.    "MOULD FILL
       ZPPT_CONFIRM-XMNGA  = I_TAB1-XMNGA.    "SCRAP
         if I_TAB1-XMNGA is NOT INITIAL.
       ZPPT_CONFIRM-GRUND     = I_TAB1-GRUND. "reason for scrap
         endif.
       ZPPT_CONFIRM-ZSUPNAME  = SNAME.        "supervioser name
       ZPPT_CONFIRM-ZHODNO    = V_ZHODNO.
       ZPPT_CONFIRM-FEVOR     = V_PRDSCHED.    "PRODUCT SCHEDULER
       ZPPT_CONFIRM-PERNR     = I_TAB1-pernr.
       ZPPT_CONFIRM-ENAME     = I_TAB1-ENAME.
       ZPPT_CONFIRM-ZUSER     = sy-uname.
       INSERT ZPPT_CONFIRM.
       IF SY-SUBRC = 0.
          DELETE TABLE I_TAB1 FROM I_TAB1.
       ENDIF.
       CLEAR  ZPPT_CONFIRM.
      ENDIF.
      ENDLOOP.
      CLEAR : OK_CODE3.
    ENDCASE.
    endmodule.                 " USER_COMMAND_9400  INPUT
    *&      Form  GETGLADATA
          text
    -->  p1        text
    <--  p2        text
    form GETGLADATA .
    refresh i_tab1.
    CLEAR : V_MATNR1.
    CONCATENATE '%' V_COLOR '%' INTO V_MATNR1.
          V_DATE = AFKO-GSTRP.
    SELECT SINGLE FEVOR ZHODNO FROM ZPP_SUP_MRP  INTO (V_PRDSCHED, V_ZHODNO)
                         WHERE ZSUPNO = ZPP_SUP_MRP-ZSUPNO.
        if sy-subrc = 0.
            CALL FUNCTION 'HR_JP_MONTH_BEGIN_END_DATE'
              EXPORTING
                iv_date                   = V_DATE
             IMPORTING
               EV_MONTH_BEGIN_DATE       = sdate
               EV_MONTH_END_DATE         = edate.
           SELECT SINGLE ENAME FROM PA0001 INTO SNAME WHERE PERNR = ZPP_SUP_MRP-ZSUPNO
                                                        AND ENDDA  = '99991231'.
            if ZMATKL <> SPACE and AFKO-PLNBEZ <> SPACE.
            select A~AUFNR
                   A~PLNBEZ
                   A~GAMNG
                   INTO corresponding fields of TABLE I_TAB1
                   FROM  AFKO AS A
                   JOIN  AFPO AS B ON
                         AMANDT = BMANDT
                    AND  AAUFNR = BAUFNR
                   JOIN  AUFK AS C ON
                         AMANDT = CMANDT
                    AND  AAUFNR = CAUFNR
                   JOIN  JEST AS D ON
                         CMANDT = DMANDT
                    AND  COBJNR = DOBJNR
                   JOIN  MARA AS E ON
                         AMANDT = EMANDT
                     AND APLNBEZ = EMATNR
                   WHERE
                          A~PLNBEZ = AFKO-PLNBEZ
                        A~PLNBEZ LIKE V_MATNR1
                     AND A~DISPO = '104'
                     AND A~GLTRP between sdate and edate
                     AND B~DAUAT = 'ZH24'
                     AND B~PWERK = T001W-WERKS
                     AND D~STAT  = 'I0002'
                     AND D~INACT <> 'X'
                     AND E~MATKL = ZMATKL.
              elseIF ZMATKL <> SPACE and AFKO-PLNBEZ = SPACE.
            select A~AUFNR
                   A~PLNBEZ
                   A~GAMNG
                   INTO corresponding fields of TABLE I_TAB1
                   FROM  AFKO AS A
                   JOIN  AFPO AS B ON
                         AMANDT = BMANDT
                    AND  AAUFNR = BAUFNR
                   JOIN  AUFK AS C ON
                         AMANDT = CMANDT
                    AND  AAUFNR = CAUFNR
                   JOIN  JEST AS D ON
                         CMANDT = DMANDT
                    AND  COBJNR = DOBJNR
                   JOIN  MARA AS E ON
                         AMANDT = EMANDT
                     AND APLNBEZ = EMATNR
                   WHERE
                  A~FEVOR = V_PRDSCHED
                         A~PLNBEZ LIKE V_MATNR1
                     AND A~DISPO = '104'
                     AND A~GLTRP between sdate and edate
                     AND B~DAUAT = 'ZH24'
                     AND B~PWERK = T001W-WERKS
                     AND D~STAT  = 'I0002'
                     AND D~INACT <> 'X'
                     AND E~MATKL = ZMATKL.
              elseIF ZMATKL = SPACE and AFKO-PLNBEZ <> SPACE.
            select A~AUFNR
                   A~PLNBEZ
                   A~GAMNG
                   INTO corresponding fields of TABLE I_TAB1
                   FROM  AFKO AS A
                   JOIN  AFPO AS B ON
                         AMANDT = BMANDT
                    AND  AAUFNR = BAUFNR
                   JOIN  AUFK AS C ON
                         AMANDT = CMANDT
                    AND  AAUFNR = CAUFNR
                   JOIN  JEST AS D ON
                         CMANDT = DMANDT
                    AND  COBJNR = DOBJNR
                  JOIN  MARA AS E ON
                        AMANDT = EMANDT
                    AND APLNBEZ = EMATNR
                   WHERE
                          A~PLNBEZ = AFKO-PLNBEZ
                        A~PLNBEZ LIKE V_MATNR1
                     AND A~DISPO = '104'
                     AND A~GLTRP between sdate and edate
                     AND B~DAUAT = 'ZH24'
                     AND B~PWERK = T001W-WERKS
                     AND D~STAT  = 'I0002'
                     AND D~INACT <> 'X'.
                    AND E~MATKL = ZMATKL.
              elseIF ZMATKL = SPACE and AFKO-PLNBEZ = SPACE.
            select A~AUFNR
                   A~PLNBEZ
                   A~GAMNG
                   INTO corresponding fields of TABLE I_TAB1
                   FROM  AFKO AS A
                   JOIN  AFPO AS B ON
                         AMANDT = BMANDT
                    AND  AAUFNR = BAUFNR
                   JOIN  AUFK AS C ON
                         AMANDT = CMANDT
                    AND  AAUFNR = CAUFNR
                   JOIN  JEST AS D ON
                         CMANDT = DMANDT
                    AND  COBJNR = DOBJNR
                  JOIN  MARA AS E ON
                        AMANDT = EMANDT
                    AND APLNBEZ = EMATNR
                   WHERE
                         A~PLNBEZ = AFKO-PLNBEZ
                         A~PLNBEZ LIKE V_MATNR1
                     AND A~DISPO = '104'
                     AND A~GLTRP between sdate and edate
                     AND B~DAUAT = 'ZH24'
                     AND B~PWERK = T001W-WERKS
                     AND D~STAT  = 'I0002'
                     AND D~INACT <> 'X'.
                    AND E~MATKL = ZMATKL.
              endif.
            IF SY-SUBRC = 0.
              gcontrol-lines = sy-dbcnt.
              LOOP AT I_TAB1.
                SELECT SINGLE WGBEZ FROM T023T INTO I_TAB1-WGBEZ
                                   WHERE MATKL = I_TAB1-PLNBEZ+0(7)
                                     AND SPRAS = 'E'.
                 IF SY-SUBRC = 0.
                    MODIFY I_TAB1 FROM I_TAB1.
                    CLEAR I_TAB1.
                 ENDIF.
              ENDLOOP.
            ENDIF.
            endif.
    sort i_tab1 by plnbez.
    endform.                    " GETGLADATA
    *&      Module  MOVE_DATA_TO_INTERNALTAB_INS  INPUT
          text
    module MOVE_DATA_TO_INTERNALTAB_INS input.
    CLEAR I_TAB1.
    CLEAR ZWERKS_HR.
    IF T001W-WERKS = '1102'.
    ZWERKS_HR = '1200'.
    ENDIF.
            if I_TAB-EMPNO <> space and I_TAB-EMPNO+0(1) <> 'I'.
              MESSAGE I991(ZMESSAGE) with 'ENTER INSPECTOR NUMBER'.
    *BREAK-POINT.
              FLAG = 'X'.
              COUNT = ICONTROL-CURRENT_LINE.
             continue.
            endif.
    IF I_TAB-EMPNO IS NOT INITIAL.
      SELECT SINGLE ENAME FROM PA0001 INTO I_TAB-ENAME
                         WHERE PERNR = I_TAB-EMPNO.
         SELECT SINGLE A~ENAME
                       A~PERNR
               A~WERKS
               B~USRID
                 INTO CORRESPONDING FIELDS OF TABLE I_FINAL
                  INTO (I_TAB-ENAME,I_TAB-pernr)
                  FROM PA0001 AS A
                  JOIN PA0105 AS B ON APERNR = BPERNR
                 WHERE B~USRID <> SPACE
                   AND B~USRID = I_TAB-EMPNO
                   AND A~endda = '99991231'
                   AND A~WERKS = ZWERKS_HR
                   AND ( B~SUBTY = 'POTT' OR
                       B~SUBTY = 'INSP' OR
                       B~SUBTY = 'GLAZ' OR
                       B~SUBTY = 'STOP' OR
                       B~SUBTY = 'SORT' ).
                       IF SY-SUBRC <> 0.
                       clear : I_TAB-ENAME,I_TAB-pernr.
                       ENDIF.
    ENDIF.
    MOVE-CORRESPONDING I_TAB TO I_TAB1.
    MODIFY I_TAB1 FROM I_TAB1 INDEX ICONTROL-CURRENT_LINE.
    endmodule.                 " MOVE_DATA_TO_INTERNALTAB_INS  INPUT
    *&      Module  MOVE_DATA_TO_INTERNALTAB_GLA  INPUT
          text
    module MOVE_DATA_TO_INTERNALTAB_GLA input.
    CLEAR I_TAB1.
    CLEAR ZWERKS_HR.

Maybe you are looking for

  • Creating a view and use the view in a model

    Hi All, I am new to OBIEE and i have a requirement that i have two fields to be added to a subject area. Since we can't add queries directly to a model, i have to create a view and then put the query in it and then use the view in that model. I could

  • Installing Solaris 8 with a NVIDIA RIVA TNT MODEL 64 video board

    I'm trying to find out if anybody knows of any compatible drivers for the NVIDIA RIVA TNT MODEL 64 video board for Solaris 8. I can install Solaris using 640 x 480 with 16 colours, and that works without any problem, but the installation does not see

  • Error: Cannot Resolve symbol

    Hi i have written this program but it is not compling properly. i do not know what to do to sort it. here is the code: import java.sql.*; import java.io.DataInputStream; import javax.swing.*; import java.awt.event.*; import java.awt.*; public class P

  • Can one post movies via iWeb which cannot be saved by the viewer?

    Does anyone know of a way to make movies on iWeb "view only" and not savable by the viewer of the website? This would enable me to post movies which I want to show but don't want them to have to have access to the file to use as they please.

  • RMI callback error

    We have a client that makes an RMI call. The server then tries to make a callback to the client. I know the client's call to the server succeeds, but when the server tries to make the callback, it gives the error below. Until recently the callback wo