Please send me some sample codes of ALVS  using function modules only

Hi,
i am new to alvs
Please send me some sample codes of alvs using function modules only.
My mail id is [email protected]
Thanks & regards,
hari priya

hI
http://www.sapdev.co.uk/reporting/reportinghome.htm SPECIAL FOR ALL ALV PROGRAMS WITH EXAMPLE CODES
Check the below links :
http://www.sap-img.com/abap/sample-programs-on-alv-grid.htm
http://www.sap-img.com/abap-function.htm
http://www.sap-basis-abap.com/sapab034.htm
http://www.erpgenie.com/abap/example_code.htm
These all are very simple ALV programs ,good luck
<b>Reward if usefull</b>

Similar Messages

  • What is the Extract statement? Please give me some sample code.?

    What is the Extract statement? Please give me some sample code.?

    Hello ,
    Once you have declared the possible record types as field groups and defined their structure, you can fill the extract dataset using the following statements: EXTRACT . When the first EXTRACT statement occurs in a program, the system creates the extract dataset and adds the first extract record to it. In each subsequent EXTRACT statement, the new extract record is added to the dataset EXTRACT HEADER. When you extract the data, the record is filled with the current values of the corresponding fields. As soon as the system has processed the first EXTRACT statement for a field group , the structure of the corresponding extract record in the extract dataset is fixed. You can no longer insert new fields into the field groups and HEADER. If you try to modify one of the field groups afterwards and use it in another EXTRACT statement, a runtime error occurs. By processing EXTRACT statements several times using different field groups, you fill the extract dataset with records of different length and structure. Since you can modify field groups dynamically up to their first usage in an EXTRACT statement, extract datasets provide the advantage that you need not determine the structure at the beginning of the program.
    Sample program:
    REPORT  ZSPFLI  LINE-SIZE 132 LINE-COUNT 65(3)
                                                 NO STANDARD PAGE HEADING.
    TABLES:SPFLI,SCARR, SFLIGHT, SBOOK.
    SELECT-OPTIONS: MYCARRID FOR SPFLI-CARRID.
    FIELD-GROUPS: HEADER, SPFLI_FG, SFLIGHT_FG, SBOOK_FG.
    INSERT:
            SPFLI-CARRID
            SPFLI-CONNID
            SFLIGHT-FLDATE
            SBOOK-BOOKID
           INTO HEADER,
            SPFLI-CARRID
            SPFLI-CONNID
            SPFLI-CITYFROM
            SPFLI-AIRPFROM
            SPFLI-CITYTO
            SPFLI-AIRPTO
            SPFLI-DEPTIME
            SCARR-CARRNAME
          INTO SPFLI_FG,
            SFLIGHT-FLDATE
            SFLIGHT-SEATSMAX
            SFLIGHT-SEATSOCC
            SFLIGHT-PRICE
          INTO SFLIGHT_FG,
            SBOOK-BOOKID
            SBOOK-CUSTOMID
            SBOOK-CUSTTYPE
            SBOOK-SMOKER
           INTO SBOOK_FG.
    SELECT * FROM SPFLI WHERE CARRID IN MYCARRID.
      SELECT SINGLE * FROM SCARR WHERE CARRID = SPFLI-CARRID.
      EXTRACT SPFLI_FG.
      SELECT * FROM SFLIGHT
       WHERE CARRID = SPFLI-CARRID AND  CONNID = SPFLI-CONNID.
        EXTRACT SFLIGHT_FG.
        SELECT * FROM SBOOK
               WHERE CARRID = SFLIGHT-CARRID AND
               CONNID = SFLIGHT-CONNID AND FLDATE = SFLIGHT-FLDATE.
          EXTRACT SBOOK_FG.
          CLEAR SBOOK.
        ENDSELECT.
        CLEAR SFLIGHT.
      ENDSELECT.
      CLEAR SPFLI.
    ENDSELECT.
    SORT.
    LOOP.
      AT SPFLI_FG.
        FORMAT COLOR COL_HEADING.
        WRITE: / SCARR-CARRNAME,
                 SPFLI-CONNID, SPFLI-CITYFROM,
                 SPFLI-AIRPFROM, SPFLI-CITYTO, SPFLI-AIRPTO, SPFLI-DEPTIME.
        FORMAT COLOR OFF.
      ENDAT.
      AT SFLIGHT_FG.
        WRITE: /15 SFLIGHT-FLDATE, SFLIGHT-PRICE, SFLIGHT-SEATSMAX,
                   SFLIGHT-SEATSOCC.
      ENDAT.
      AT SBOOK_FG.
        WRITE: /30 SBOOK-BOOKID, SBOOK-CUSTOMID,
                     SBOOK-CUSTTYPE, SBOOK-SMOKER.
      ENDAT.
    ENDLOOP.

  • Comparing ALV using Function modules  and OO ALV

    Hi All,
    Please provide me what are the advantages of developing ALV using Objects compared to creation using function modules. What are the disadvantages of creating using the conventional FM way.
    I have not worked much on ALV using Function modules, have been developing using standard abap classes. I wanted to have an detailed understanding and differences between the two.
    Please provide your views on the same.
    I have searched SDN forum, but didnt find much information, so it will be of great help if you provide some inputs.
    Thanks & Regards,
    Navneeth K.

    Hello,
    Check this link
    ALV FUNCTION MODULE AND OBJECT ORIENTED ?
    Example programs
    http://saplab.blogspot.com/2007/10/sample-abap-program-of-alv-grid-control.html
    http://www.abapcode.info/2007/06/object-oriented-alv-using-two.html

  • Comparing OO ALV and ALV using Function modules

    Hi All,
    Please provide me what are the advantages of developing ALV using Objects compared to creation using function modules. What are the disadvantages of creating using the conventional FM way.
    I have not worked much on ALV using Function modules, have been developing using standard abap classes. I wanted to have an detailed understanding and differences between the two.
    Please provide your views on the same.
    I have searched SDN forum, but didnt find much information, so it will be of great help if you provide some inputs.
    Thanks & Regards,
    Navneeth K.

    Hi, Navneeth,
    With ALV functions, you can everything that you would do otherwise with the OOPS ALV. However , I don't think you can possibily have more controls in case of alv function because it occupies the entire screen and the function only calls 2 screens internally ( screen numbers 500 and 700 (for popup alv)).
    But with OOPS on the other hand, you can have many controls on one screen, for example, you can have 2 ALV lists, or a splitter control with one of them having a Tree control and the other alv grid/list, pictures etc.
    So the sole motive of the function is if you want to display a list, but when developing a serious application, I  would go for OOPs ALV.
    regards,
    Advait

  • Can u please send me a sample code to upload and download a file using java

    Hi,
    Please can u send me a sample code to upload a file and to download the same file from a remote server using a java servlets. The file should be read byte by byte.
    Message was edited by:
    user461713

    Hi, Thank u.
    Sorry, I forgot to attach a code. Here it is.
    Actually i need to upload a file to a remote server and download it from a server to my machine. I'm trying it using servlets and using tomcat5.0 as a servlet container. Here i'm sening a code used to upload a file. Let me know whether it works. Only few lines are here.
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.lang.Object;
    import java.util.*;
    import java.lang.String;
    import com.oreilly.servlet.MultipartRequest;
    public class FileUpload extends HttpServlet{
         public void doPost(HttpServletRequest req, HttpServletResponse res)throws
         ServletException, IOException{
         MultipartRequest multi=new MultipartRequest(req);     
         String file="file1";
         byte[] b=file.getBytes();
         InputStream in=null;
         BufferedInputStream bis=null;
         FileWriter fw=null;
    try{
         in=multi.getInputStream("file1");
    bis=new BufferedInputStream(in);
         File output=new File("/fileuploadtest");
         fw=new FileWriter(output);
              int i;
              i=bis.read();
              while (i != -1) {
    fw.write(i);
    i = bis.read();
         catch(IOException e){
              System.out.println("Exception=" +e);
    finally{
         try{
              if(in!=null)
              in.close();
              if(bis!=null)               
              bis.close();
              if(fw!=null)
              fw.close();
         catch(Exception e){
              System.out.println(e);
    This code is giving error as: cannot resolve symbol: class MultipartRequest
    Why is this happening?
    Pls let me know whether this code works or no and also i have written form.html.
    Can u pls tel me whether there are ways in which i can write a code to upload a file using servlets without using third party packages. Pls help.
    Also how should be the servlet mapping for this code.?
    Regards
    Message was edited by:
    user461713

  • Grouping and Page Break in ALV using Function Modules

    Hi all,
    I am trying to develop an ALV Report that will be grouped by vendor, some vendor information to be displayed on header. And, after each vendor;s records there should be a page break.
    It should be something like this:
    Vendor Number: 00012345454
    Vendor Name: ABC Technologies, Inc
    Vendor Country: USA
    Item....Price...... Descriptopm
    123....100,00......this is description
    124....120.00......this is another description
    PAGE BREAK
    Vendor Number: 000123456545
    Vendor Name: My Bank
    Vendor Country: USA
    Item....Price..... Descriptopm
    223....32,00......this is my description
    224....120.00......this is another description
    Can anybody give some sample code for it ? I have tried a few codes from web, but they are not working.
    Thanks.

    Hi,
    Try the following:
    1. Build your sorting criteria. Pass this to ALV FM.
      gs_sort-fieldname = 'VENDOR'.
      gs_sort-group = '*'. "new page
      gs_sort-up = 'X'.
      APPEND gs_sort TO gt_sort.
    2. Add event group level change. Pass this to ALV FM
      gs_event-name = 'GROUPLEVEL_CHANGE'.
      gs_event-form = 'GROUPLEVEL_CHANGE'.
      APPEND gs_event TO gt_event.
    Inside the form, retrieve your vendor details.
    FORM grouplevel_change USING gs_lineinfo
                                 gs_groups TYPE kkblo_grouplevels.
      DATA: l_index     TYPE i.
      IF gs_groups-level = 1.
        l_index = gs_groups-index_to + 1.
        READ TABLE gt_display INDEX l_index  INTO gw_display.   
      ENDIF.
    3. In the event top-of-page, display vendor details using write statements. For the first record, your structure (gw_display) will be blank, read from your data table first
    FORM top_of_page.
      IF gw_display IS INITIAL.
        READ TABLE gt_display INDEX 1 INTO l_display.
        IF sy-subrc = 0.
          WRITE: / l_display-vendor
        ENDIF.
      ELSE.
        WRITE: / gw_display-vendor.
        CLEAR: gw_display.
      ENDIF.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
        EXPORTING
          i_callback_program       = sy-repid
          i_callback_pf_status_set = 'SET_STATUS'
          i_callback_user_command  = 'USER_COMMAND'
          is_layout                = gs_layout
          it_fieldcat              = gt_fcat[]
          it_sort                  = gt_sort[]
          i_save                   = 'A'
          it_events                = gt_event
        TABLES
          t_outtab                 = gt_display[]
        EXCEPTIONS
          program_error            = 1
          OTHERS                   = 2.
    Hope this helps.

  • ABAP code which will use function module during field mapping in LSMW

    Hi,
    During field mapping in LSMW, for one of the field called field, I want to use a function module 'QF05_RANDOM_INTEGER', which will generate random numbers and map that random number to that field.
    How do I write ABAP code which uses function module, during filed mapping for a particluar field in LSMW ?
    Please help...
    Regards,
    Tushar.

    Hi Tushar,
    You can write in FORM ROUTINE and LSMW.
    I hope you know how to write ABAP code at field level.
    If not ...
    Come to change mode->select the field->Rule->ABAP Code
    write a perform statement in ABAP code at field level.
    <b>PERFORM test</b> using val
                 changing valu.
    Go to Utilities(at menu)->switch layout-> extras ->select Layout->check Form routine-> it will display a FORM Routine... at bottom
    this is the place where you can write some code for
    <b> FORM test</b> using value
              changing value1
      FM call....
    .ENDFORM  
    Get the value1 returned and use for the Field population.
    Reward points if this Helps.
    Manish
    Message was edited by:
            Manish Kumar

  • How do I insert a logo in ALV using Function Modules?

    hai !
           i want to display the logo on the grid .
        can any one suggest me which function i should use?
        any  help will be appreciated.

    Hi,
    Look at the sample code to display LOGO.
      call function 'REUSE_ALV_GRID_DISPLAY'
         exporting
           i_callback_program      = i_repid
           i_callback_user_command = 'USER_COMMAND_PERNR'
           it_fieldcat             = header
           is_layout               = gt_layout
           i_callback_top_of_page  = 'TOP-OF-PAGE1'
           i_grid_title            = xyz
           it_sort                 = gt_sort[]
           i_default               = 'X'
           i_save                  = 'U'
           is_variant              = gt_variant
           it_events               = gt_events
          tables
           t_outtab                = t_output.
      clear t_output.
    Form TOP-OF-PAGE1
    form top-of-page1.
      data: header type slis_t_listheader,
      wa type slis_listheader. "infield like wa-info, nline type n.
    TITLE AREA
      wa-typ = 'S'.
      wa-info = text-h04.
      append wa to header.
      wa-typ = 'S'.
      write sy-datum to wa-info mm/dd/yyyy.
      concatenate text-h03 wa-info into wa-info separated by space.
      append wa to header.
      wa-typ = 'S'.
      concatenate text-h02 sy-uname into wa-info separated by space.
      append wa to header.
      wa-typ = 'S'.
      concatenate text-h01 sy-repid into wa-info separated by space.
      append wa to header.
    ********" LOGO
      call function 'REUSE_ALV_COMMENTARY_WRITE'
           exporting
                it_list_commentary = header
                i_logo             = 'ENJOYSAP_LOGO'.
    *********" LOGO
    endform.
    Here in TOP-OF-PAGE form it will show you the Prog name,Date, User Name.
    Just you need to give the text in it.
    You can refer the below link also.
    http://www.sapdevelopment.co.uk/reporting/alv/alvgrid.htm
    Thanks.
    If this helps you reward with points.
    Message was edited by: KDeepak

  • Could you please send me some transaction in workflow

    hi all,
      anybody knows in workflow. could you please send me some transaction codes in workflow. so that i can check those transactions in workflwo.

    Hi,
    Go to SAP Menu ---> Tools ---> Business Workflow ---> Development there you have all the Workflow related T-Codes.
    Re: Workflow - Transactions
    Regards,
    Ramu N.

  • Send some sample program for ALV reports

    Hi all ,
    send some sample program for ALV reports for learing purpose
    tahnks.

    Hi ,
    Resource Master
    Program                     YPPCRR                  *
    Program type                Report Program                     *
    Title                       Resource Master Dara for Updation  *
    Author                      Naga Raju                          *
    Requested By                Balaji                             *
    Date Written                24.05.2007                         *
    Specification Id            F2-DP-FS-2-0002                    *
    Transport Request                                              *
    On-line Documentation
    Description
    This Program updates the Location Mater through the Transaction
    /SAPAPO/LOC3 Based on the User Selection
    Update
    Reset
    No Action
    Output
    ALV List output of the main Program
    ALV List output of the Error Log
    REPORT  YPPCRR NO STANDARD PAGE HEADING
                   LINE-SIZE 120
                   LINE-COUNT 62(4)
                   MESSAGE-ID yap..
    Global data
    Include where all the data declarations are coded.
      INCLUDE YPPCRR_data.
    *Initialization
    INITIALIZATION.
    perform init_variant.
    Constants
    CONSTANTS: c_formname_top_of_page TYPE slis_formname
    VALUE 'F_TOP_OF_PAGE'.
    Selection-Screen
    SELECTION-SCREEN : BEGIN OF BLOCK b1 WITH FRAME TITLE text-040.
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS:p_prs RADIOBUTTON GROUP ztyp USER-COMMAND ucom DEFAULT 'X'.
    SELECTION-SCREEN COMMENT 3(28) text-003.
    position 40.
    parameters: p_file1 TYPE rlgrap-filename.
    SELECTION-SCREEN END OF LINE.
    skip 5.
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS: p_aps RADIOBUTTON GROUP ztyp.
    SELECTION-SCREEN COMMENT 3(28) text-004.
    position 40.
    parameters: p_file2 type rlgrap-filename.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END OF BLOCK b1.
    AT SELECTION-SCREEN .
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file1.
      CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
       EXPORTING
         program_name        = syst-repid
      DYNPRO_NUMBER       = SYST-DYNNR
         field_name          = p_file1
      STATIC              = ' '
      MASK                = ' '
        CHANGING
          file_name           = p_file1
    EXCEPTIONS
      MASK_TOO_LONG       = 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.
    START-OF-SELECTION.
    if p_prs = 'X'.
         PERFORM f_read_datum1 TABLES t_res_head
                          USING p_file1
                          CHANGING w_subrc.
      elseif p_aps = 'X'.
         PERFORM f_read_datum2 TABLES t_res_head
                          USING p_file2
                          CHANGING w_subrc.
    endif.
    IF w_subrc = 0.
    Validations
    PERFORM VALIDATION.
    PERFORM display_alv.
    IF SY-UCOMM = '&F03'
    or SY-UCOMM = '&F12'
    or SY-UCOMM = '&F15'.
    LEAVE LIST-PROCESSING.
    ELSE.
    ENDIF.
    ELSE.
    Message s100 with text-002.
    ENDIF.
    END-OF-SELECTION.
    Forms part*
    INCLUDE YPPCRR_forms.
    *&  Include           YPPCRR_DATA
    Type-Pools
      TYPE-POOLS: slis.
    *TYPES
    DATA:  BEGIN OF tl_res_head.
            INCLUDE STRUCTURE ypp_res_head.
    DATA:  END OF tl_res_head.
    DATA:  BEGIN OF tl_res_head_val.
            INCLUDE STRUCTURE ypp_resv.
    DATA:  END OF tl_res_head_val.
    DATA : BEGIN OF ty_errlog ,
             counter type i,
             type(2) ,
             name(10) TYPE c,
             vrsioid(22) TYPE c,
             restype TYPE c,
             message(80) TYPE c,
           END OF ty_errlog.
    Global Variables
    DATA : gc_flag(1) TYPE c,
           w_val_err_flag(1) type c.
    DATA: w_filename TYPE rlgrap-filename,
          w_subrc TYPE sy-subrc,
          w_t_res_head TYPE slis_t_fieldcat_alv,
          wa_t_res_head TYPE slis_fieldcat_alv.
    DATA :  wa_date(10) TYPE c,
            wa_time(10) TYPE c,
           wa_title(40) TYPE c,
           wa_type(4) TYPE c  .
    DATA: BAPI_RUN_YES_NO TYPE C.
    *Structure
    *INTERNAL TABLES USED BY ALV
    DATA:
    it_fieldcat_alv  TYPE slis_t_fieldcat_alv,
    IT_FIELDCAT_ALV_ERR  TYPE SLIS_T_FIELDCAT_ALV,
    it_status TYPE slis_formname VALUE 'F_MAIN',
    it_user_command TYPE slis_formname VALUE 'F_USER_COMMAND',
    it_events        TYPE slis_t_event,
    it_event_exit    TYPE slis_t_event_exit,
    it_list_comments TYPE slis_t_listheader,
    it_excluding     TYPE slis_t_extab,
    it_sort          TYPE slis_t_sortinfo_alv.
    *Internal Table Declarations
    DATA : BEGIN OF t_imex OCCURS 0 ,
                    string(256) TYPE c,
           END OF t_imex.
    DATA : fcode TYPE TABLE OF sy-ucomm.
    DATA : fcode_bdc TYPE TABLE OF sy-ucomm.
    DATA : fcode_error TYPE TABLE OF sy-ucomm.
    DATA : fcode_final TYPE TABLE OF sy-ucomm.
    STRUCTURE and WORKARES
    *Internal Table Declarations
    DATA : t_res_head  like  tl_res_head occurs 0 WITH HEADER LINE.
    DATA : t_res_head_val like tl_res_head_val occurs 0 with header line.
    data :l_res_head LIKE LINE OF t_res_head.
    DATA : w_file TYPE string.
    *DATA : wa_vrsioid(22) type c,
          wa_locno(20) type c,
          wa_calendar(2) type c,
          wa_planner(3) type c.
    DATA: T_RETURN LIKE BAPIRET2 OCCURS 0 WITH HEADER LINE.
    DATA: RESOURCE_HEAD LIKE BAPI10004RESHEAD OCCURS 0 WITH HEADER LINE,
          RESOURCE_HEAD_X LIKE BAPI10004RESHEADX OCCURS 0 WITH HEADER LINE,
          RESOURCE_TEXT LIKE BAPI10004RESTEXT OCCURS 0 WITH HEADER LINE,
          RESOURCE_TEXT_X LIKE BAPI10004RESTEXTX OCCURS 0 WITH HEADER LINE.
    data : t_errlog like ty_errlog occurs 0 with header line.
    DATA : wk_lines TYPE i,
           wk_errlines TYPE i,
           wk_count TYPE i.
    DATA:   g_tabname TYPE slis_tabname VALUE 'T_RES_HEAD'.
    Variables to be used by ALV
    DATA:
      wk_variant          LIKE disvariant,
      wx_variant         LIKE disvariant,
      wk_variant_save(1)  TYPE c,
      wk_exit(1)          TYPE c,
      wk_repid            LIKE sy-repid,
      wk_user_specific(1) TYPE c,
      wk_callback_ucomm   TYPE slis_formname,
      wk_callback_status   TYPE slis_formname,
    wk_callback_status1  TYPE slis_formname,
      wk_print            TYPE slis_print_alv,
      wk_layout           TYPE slis_layout_alv,
      wk_html_top_of_page TYPE  slis_formname,
      wk_fieldcat_alv     LIKE LINE OF it_fieldcat_alv,
      wk_excluding        LIKE LINE OF it_excluding,
      wk_events           LIKE LINE OF it_events,
      wk_event_exit       LIKE LINE OF it_event_exit,
      wk_list_comments    LIKE LINE OF it_list_comments,
      wk_list1_comments    LIKE LINE OF it_list_comments,
      wk_list2_comments    LIKE LINE OF it_list_comments,
      wk_sort             LIKE LINE OF it_sort.
    *DATA :gc_delete_flag(1).
    *&  Include           YAPOLOC_FORMS
    FORM display_alv .
      PERFORM f_fieldcat_build.
      PERFORM f_event_build.
      PERFORM f_exclude_build.
      PERFORM f_print_build.
      PERFORM f_layout_build.
      PERFORM f_display_data.
    ENDFORM.                    " display_alv
    *&      Form  f_fieldcat_build
          text
    FORM f_fieldcat_build .
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
        EXPORTING
          i_program_name   = wk_repid
          i_structure_name = 'YPP_RESV'
          i_inclname       = wk_repid
        CHANGING
          ct_fieldcat      = it_fieldcat_alv.
    ENDFORM.                    " F_FIELDCAT_BUILD
    *&      Form  F_EVENT_BUILD
          text
    >  p1        text*  <  p2        text
    FORM f_event_build .
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
        EXPORTING
          i_list_type = 0
        IMPORTING
          et_events   = it_events.
      READ TABLE it_events WITH KEY
      name = slis_ev_top_of_page INTO wk_events.
      IF sy-subrc = 0.
        MOVE c_formname_top_of_page TO wk_events-form.
        MODIFY it_events FROM wk_events INDEX sy-tabix.
      ENDIF.
    ENDFORM.                    " F_EVENT_BUILD
    *&      Form  F_EXCLUDE_BUILD
          text
    -->  p1        text
    <--  p2        text
    FORM f_exclude_build .
      wk_excluding = '&GRAPH'. "Graphic
      APPEND wk_excluding TO it_excluding.
    ENDFORM.                    " F_EXCLUDE_BUILD
    *&      Form  F_PRINT_BUILD
          text
    -->  p1        text
    <--  p2        text
    FORM f_print_build .
      wk_print-no_print_listinfos = 'X'.
    ENDFORM.                    " F_PRINT_BUILD
    *&      Form  F_LAYOUT_BUILD
          text
    -->  p1        text
    <--  p2        text
    FORM f_layout_build .
      wk_layout-zebra                = 'X'.
    WK_LAYOUT-COLWIDTH_OPTIMIZE    = 'X'.
      wk_layout-detail_popup         = 'X'.
      wk_layout-detail_initial_lines = 'X'.
      wk_layout-detail_titlebar      = 'Details '.
    ENDFORM.                    " F_LAYOUT_BUILD
    *&      Form  F_DISPLAY_DATA
          text
    -->  p1        text
    <--  p2        text
    FORM f_display_data .
      wk_callback_ucomm = 'CALLBACK_UCOMM'.
      IF sy-ucomm = 'UPD' OR sy-ucomm = space .
        wk_callback_status   = 'CALLBACK_STATUS'.
      ENDIF.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_background_id             = 'SIWB_WALLPAPER'
          i_callback_program          = wk_repid
         i_callback_html_top_of_page = 'HTML_TOP_OF_PAGE'
          i_callback_pf_status_set    = wk_callback_status
          i_callback_user_command     = wk_callback_ucomm
          it_sort                     = it_sort
          i_default                   = 'X'
          i_save                      = 'A'
          is_variant                  = wk_variant
          is_layout                   = wk_layout
          it_fieldcat                 = it_fieldcat_alv
          it_events                   = it_events
          it_event_exit               = it_event_exit
          it_excluding                = it_excluding
          is_print                    = wk_print
        TABLES
          t_outtab                    = t_res_head_val.
    ENDFORM.                    " F_DISPLAY_DATA
    ALV for Error Log
    *&      Form  display_alv_ERR
          text
    -->  p1        text
    <--  p2        text
    FORM display_alv_err .
      PERFORM f_fieldcat_build_err.
      PERFORM f_event_build_err.
      PERFORM f_exclude_build_err.
      PERFORM f_print_build_err.
      PERFORM f_layout_build_err.
      PERFORM f_display_data_err.
    ENDFORM.                    " display_alv_ERR
    *&      Form  F_FIELDCAT_BUILD_err
          text
    -->  p1        text
    <--  p2        text
    FORM f_fieldcat_build_err .
    BREAK-POINT.
      REFRESH it_fieldcat_alv.
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
        EXPORTING
          i_program_name     = wk_repid
          i_internal_tabname = 'TY_ERRLOG'
      i_structure_name = 'YPP_ERR_LOG'
          i_inclname         = wk_repid
        CHANGING
          ct_fieldcat        = it_fieldcat_alv_err.
      LOOP AT it_fieldcat_alv INTO wk_fieldcat_alv.
        CASE wk_fieldcat_alv-fieldname.
          WHEN 'COUNTER'.
            wk_fieldcat_alv-seltext_s = text-023.
            wk_fieldcat_alv-seltext_m = text-023.
            wk_fieldcat_alv-seltext_l = text-023.
            wk_fieldcat_alv-reptext_ddic = text-023.
            wk_fieldcat_alv-edit         = 'X'.
          WHEN 'TYPE'.
            wk_fieldcat_alv-seltext_s = text-009.
            wk_fieldcat_alv-seltext_m = text-009.
            wk_fieldcat_alv-seltext_l = text-009.
            wk_fieldcat_alv-reptext_ddic = text-009.
            wk_fieldcat_alv-edit         = 'X'.
          WHEN 'NAME'.
            wk_fieldcat_alv-seltext_s = text-010.
            wk_fieldcat_alv-seltext_m = text-010.
            wk_fieldcat_alv-seltext_l = text-010.
            wk_fieldcat_alv-reptext_ddic = text-010.
            wk_fieldcat_alv-edit         = 'X'.
          WHEN 'VRSIOID'.
            wk_fieldcat_alv-seltext_s = text-011.
            wk_fieldcat_alv-seltext_m = text-011.
            wk_fieldcat_alv-seltext_l = text-011.
            wk_fieldcat_alv-reptext_ddic = text-011.
            wk_fieldcat_alv-edit         = 'X'.
          WHEN 'RESTYPE'.
            wk_fieldcat_alv-seltext_s = text-012.
            wk_fieldcat_alv-seltext_m = text-012.
            wk_fieldcat_alv-seltext_l = text-012.
            wk_fieldcat_alv-reptext_ddic = text-012.
            wk_fieldcat_alv-edit         = 'X'.
          WHEN 'MESSAGE'.
            wk_fieldcat_alv-seltext_s = text-013.
            wk_fieldcat_alv-seltext_m = text-013.
            wk_fieldcat_alv-seltext_l = text-013.
            wk_fieldcat_alv-reptext_ddic = text-013.
            wk_fieldcat_alv-edit         = 'X'.
          WHEN OTHERS.
        ENDCASE.
        MODIFY it_fieldcat_alv FROM wk_fieldcat_alv.
      ENDLOOP.
    ENDFORM.                    " F_FIELDCAT_BUILD_err
    *&      Form  F_EVENT_BUILD_err
          text
    -->  p1        text
    <--  p2        text
    FORM f_event_build_err .
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
        EXPORTING
          i_list_type = 0
        IMPORTING
          et_events   = it_events.
      READ TABLE it_events WITH KEY name = slis_ev_top_of_page
                                   INTO wk_events.
      IF sy-subrc = 0.
        MOVE c_formname_top_of_page TO wk_events-form.
        MODIFY it_events FROM wk_events INDEX sy-tabix.
      ENDIF.
    ENDFORM.                    " F_EVENT_BUILD_err
    *&      Form  F_EXCLUDE_BUILD_err
          text
    -->  p1        text
    <--  p2        text
    FORM f_exclude_build_err .
      wk_excluding = '&GRAPH'. "Graphic
      APPEND wk_excluding TO it_excluding.
    ENDFORM.                    " F_EXCLUDE_BUILD_err
    *&      Form  F_PRINT_BUILD_err
          text
    -->  p1        text
    <--  p2        text
    FORM f_print_build_err .
      wk_print-no_print_listinfos = 'X'.
    ENDFORM.                    " F_PRINT_BUILD_err
    *&      Form  F_LAYOUT_BUILD_err
          text
    -->  p1        text
    <--  p2        text
    FORM f_layout_build_err .
      wk_layout-zebra                = 'X'.
    WK_LAYOUT-COLWIDTH_OPTIMIZE    = 'X'.
      wk_layout-detail_popup         = 'X'.
      wk_layout-detail_initial_lines = 'X'.
      wk_layout-detail_titlebar      = 'Details '.
    ENDFORM.                    " F_LAYOUT_BUILD_err
    *&      Form  F_DISPLAY_DATA_err
          text
    -->  p1        text
    <--  p2        text
    FORM f_display_data_err .
      wk_callback_ucomm = 'CALLBACK_UCOMM'.
    IF SY-UCOMM ne '&F03'.
      wk_callback_status = 'CALLBACK_STATUS'.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_background_id          = 'SIWB_WALLPAPER'
          i_callback_program       = wk_repid
          i_callback_pf_status_set = wk_callback_status
          i_callback_user_command  = wk_callback_ucomm
          it_sort                  = it_sort
          i_default                = 'X'
          i_save                   = 'A'
          is_variant               = wk_variant
          is_layout                = wk_layout
          it_fieldcat              = it_fieldcat_alv_err
          it_events                = it_events
          it_event_exit            = it_event_exit
          it_excluding             = it_excluding
          is_print                 = wk_print
        TABLES
          t_outtab                 = t_errlog.
        KEEP EERRLOG BUTTON
      SET PF-STATUS 'ZSTANDARD' EXCLUDING 'UPD' IMMEDIATELY.
    ENDFORM.                    "f_display_data_err
    **&      Form  F_TOP_OF_PAGE
          text
    FORM f_top_of_page.
      CLEAR: it_list_comments[],
             wk_list_comments,
             wk_list1_comments,
             wk_list2_comments.
      wk_list_comments-typ  = 'H'. "H=Header,S=Selection, A=Action
      wk_list_comments-key  = ''.
      CASE sy-ucomm.
        WHEN ''.
          wk_list_comments-info = text-030.
        WHEN 'UPD'.
          IF t_errlog[] IS INITIAL.
            wk_list_comments-info = text-031.
          ELSE.
            wk_list_comments-info = text-032.
          ENDIF.
        WHEN 'ERRLOG'.
          wk_list_comments-info = text-032.
        WHEN '&F03'.
          wk_list_comments-info = text-031.
        WHEN '&F15'.
          wk_list_comments-info = text-031.
        WHEN '&F12'.
          wk_list_comments-info = text-031.
      ENDCASE.
      APPEND wk_list_comments TO it_list_comments.
      WRITE sy-datum TO wa_date.
      WRITE sy-uzeit TO wa_time.
      wk_list_comments-typ  = 'S'. "H=Header, S=Selection, A=Action
      wk_list_comments-key  = ''.
      wk_list_comments-info = 'User:'.
      wk_list1_comments-info = sy-uname.
      CONCATENATE wk_list_comments wk_list1_comments
      INTO wk_list2_comments.
      APPEND wk_list2_comments TO it_list_comments.
      wk_list_comments-typ  = 'S'. "H=Header, S=Selection, A=Action
      wk_list_comments-key  = ''.
      wk_list_comments-info = '                   Run Date : '.
      wk_list1_comments-info = wa_date.
      CONCATENATE wk_list_comments wk_list1_comments
      INTO wk_list2_comments .
      APPEND wk_list2_comments TO it_list_comments.
      wk_list_comments-typ  = 'S'. "H=Header, S=Selection, A=Action
      wk_list_comments-key  = ''.
      wk_list_comments-info = 'Run Time : '.
      wk_list1_comments-info = wa_time.
      CONCATENATE wk_list_comments wk_list1_comments
      INTO wk_list2_comments .
      APPEND wk_list2_comments TO it_list_comments.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
         I_LOGO             = 'ENJOYSAP_LOGO'
          it_list_commentary =  it_list_comments.
    ENDFORM.                    "F_TOP_OF_PAGE
          FORM USER_COMMAND_SAMPLE                                  *
    -->  UCOMM                                                     *
    -->  SELFIELD                                                  *
    FORM callback_ucomm USING ucomm LIKE sy-ucomm
                         selfield TYPE slis_selfield.
      DATA: v_langu(2) ,
             v_loctype TYPE  /sapapo/c_loctype.
      data err_flg(1).
      IF  bapi_run_yes_no IS INITIAL.
        CASE sy-ucomm.
          WHEN 'UPD'.
            bapi_run_yes_no = 'X'.
            LOOP AT t_res_head_val  WHERE val_err_msg  EQ space.
              v_langu = 'EN'.
               refresh tables
              REFRESH : resource_head ,
                        resource_head_x ,
                        resource_text ,
                        resource_text_x,
                        t_return.
              CLEAR   : resource_head ,
                        resource_head_x ,
                        resource_text ,
                        resource_text_x,
                        t_return .
              resource_head-resource   = t_res_head-name .
              resource_head-restype    = t_res_head-restype.
              resource_head-location   = t_res_head-locno.
              CLEAR : v_loctype .
              SELECT SINGLE loctype  FROM  /sapapo/loc CLIENT SPECIFIED
                     INTO v_loctype
                     WHERE  mandt    = sy-mandt
                     AND    locno    = t_res_head-locno.
              resource_head-loctype  = v_loctype.
              resource_head-calendar   = t_res_head-calendar.
              resource_head-type       = t_res_head-type.
              IF t_res_head-type = '03'.
                resource_head-dimension_bucket = t_res_head-dimension_bucket.
              ELSE.
                resource_head-dimension_bucket = space.
              ENDIF.
              APPEND resource_head.
              CLEAR  resource_head.
              resource_head_x-resource = t_res_head-name.
              resource_head_x-restype  = 'X'.
              resource_head_x-location = 'X'.
              resource_head_x-loctype  = 'X'.
              resource_head_x-calendar = 'X'.
              resource_head_x-type     = 'X'.
              IF t_res_head-type = '03'.
                resource_head_x-dimension_bucket = 'X'.
              ELSE.
                resource_head_x-dimension_bucket = space.
              ENDIF.
              APPEND resource_head_x.
              CLEAR  resource_head_x.
              resource_text-resource = t_res_head-name.
              resource_text-langu    = v_langu.
              resource_text-res_short_text = t_res_head-text.
              APPEND resource_text.
              CLEAR  resource_text.
              resource_text_x-resource = t_res_head-name.
              resource_text_x-langu    = v_langu.
              resource_text_x-res_short_text = 'X'.
              APPEND resource_text_x.
              CLEAR  resource_text_x.
               call bapi
              CALL FUNCTION 'BAPI_RSSRVAPS_SAVEMULTI_30A'
                EXPORTING
                  logical_system                      = 'AD2CLNT200'
                 business_system_group               =  'BSG001'
                 commit_control                      = 'E'
               NO_CREATE                           = ' '
               TABLES
                 resource_head                       =  resource_head
                 resource_head_x                     =  resource_head_x
                 resource_text                       =  resource_text
                 resource_text_x                     =  resource_text_x
                 return                              =  t_return.
              IF sy-subrc = 0.
                LOOP AT t_return WHERE type = 'E'
                              OR type = 'A'.
                  MOVE t_res_head_val-counter TO t_errlog-counter.
                  MOVE t_res_head_val-type TO t_errlog-type.
                  MOVE t_res_head_val-name TO t_errlog-name.
                  MOVE t_res_head_val-vrsioid TO t_errlog-vrsioid.
                  MOVE t_res_head_val-restype TO t_errlog-restype.
                  MOVE t_return-message TO t_errlog-message.
                  APPEND t_errlog.
                  CLEAR t_errlog..
                ENDLOOP.
    IF not t_errlog[] is initial..
               IF sy-subrc = 0.
                ERROR POP UP
                  MESSAGE  text-007 type 'I'.
                ELSE.
                   err_flg = 'X'.
               SUCC POP UP
                 MESSAGE text-008 type 'I'.
                ENDIF.
              ELSE.                                             "NE 0
                LOOP AT t_return WHERE type = 'E'
                              OR type = 'A'.
                  MOVE t_res_head_val-counter TO t_errlog-counter.
                  MOVE t_res_head_val-type TO t_errlog-type.
                  MOVE t_res_head_val-name TO t_errlog-name.
                  MOVE t_res_head_val-vrsioid TO t_errlog-vrsioid.
                  MOVE t_res_head_val-restype TO t_errlog-restype.
                  MOVE t_return-message TO t_errlog-message.
                  APPEND t_errlog.
                  CLEAR t_errlog..
             ENDLOOP.
                IF sy-subrc = 0.
                ELSE.
                  MOVE t_res_head_val-counter TO t_errlog-counter.
                  MOVE t_res_head_val-type TO t_errlog-type.
                  MOVE t_res_head_val-name TO t_errlog-name.
                  MOVE t_res_head_val-vrsioid TO t_errlog-vrsioid.
                  MOVE t_res_head_val-restype TO t_errlog-restype.
                  MOVE 'Error in Creation' TO t_errlog-message.
                  APPEND t_errlog.
                  CLEAR t_errlog..
                ENDIF.
              ENDIF.
          ENDLOOP.
            gc_flag = 'X'.
            REFRESH fcode.
       if err_flg = 'X'.
                  MESSAGE text-008 type 'I'.
       endif.
        ENDCASE.
      ENDIF.
      IF NOT t_errlog[] IS INITIAL.
        wk_list_comments-info = text-032.
        APPEND wk_list_comments TO it_list_comments.
        APPEND 'UPD' TO fcode_error.
        APPEND 'ERRLOG' TO fcode_error.
        SET PF-STATUS 'ZSTANDARD' EXCLUDING fcode_error.
        PERFORM display_alv_err.
      ELSE.
      ENDIF.
    ENDFORM.                    "CALLBACK_UCOMM=
    *&      Form  CALLBACK_STATUS
          text
         -->RT_EXTAB   text
    FORM callback_status USING rt_extab TYPE slis_t_extab.
    IF  bapi_run_yes_no IS NOT INITIAL .
        IF t_errlog[] IS INITIAL.
          REFRESH fcode.
          APPEND 'UPD' TO fcode.
          APPEND 'ERRLOG' TO fcode.
            SET PF-STATUS 'ZSTANDARD' EXCLUDING 'ERRLOG'.
          SET PF-STATUS 'ZSTANDARD' EXCLUDING fcode IMMEDIATELY .
        ENDIF.
      ELSE.
        SET PF-STATUS 'ZSTANDARD' EXCLUDING 'ERRLOG' IMMEDIATELY .
      ENDIF.
    ENDFORM.                    "CALLBACK_STATUS
    *&      Form  CALLBACK_STATUS1
          text
         -->RT_EXTAB   text
    FORM callback_status1 USING rt_extab TYPE slis_t_extab.
      SET PF-STATUS 'ZSTANDARD' EXCLUDING 'UPD'.
    ENDFORM. " CALLBACK_STATUS
    *&      Form  CALLBACK_STATUS2
          text
         -->RT_EXTAB   text
    FORM callback_status2 USING rt_extab TYPE slis_t_extab.
      REFRESH fcode_final.
      IF sy-ucomm NE '&F03'.
        APPEND 'UPD'  TO fcode_final.
        APPEND 'ERRLOG' TO fcode_final.
        SET PF-STATUS 'ZSTANDARD' EXCLUDING fcode_final.
      ELSE.
        SET PF-STATUS 'ZSTANDARD' EXCLUDING 'UPD'.
      ENDIF.
    ENDFORM.                    "CALLBACK_STATUS2
    *&      Form  callback_ucomm_E
          text
         -->UCOMM      text
         -->SELFIELD   text
    FORM callback_ucomm_e USING ucomm LIKE sy-ucomm
                         selfield TYPE slis_selfield.
      CASE sy-ucomm.
        WHEN 'ERRLOG' .
          PERFORM display_alv_err.
        WHEN '&F03'.
          SET PF-STATUS 'ZSTANDARD' EXCLUDING 'UPD' IMMEDIATELY .
          PERFORM display_alv .
      ENDCASE.
    ENDFORM.                    "CALLBACK_UCOMM=
    *&      Form  init_variant
          text
    -->  p1        text
    <--  p2        text
    FORM init_variant .
      CLEAR: wk_variant.
      wk_repid              = sy-repid.
      wk_variant-report     = wk_repid.
      wk_variant-username   = sy-uname.
      wk_variant_save       = 'A'. "All types
    ENDFORM.                    " init_variant
    *&      Form  f_read_datum1
          text
         -->P_T_RES_HEAD  text
         -->P_P_FILE1  text
         <--P_W_SUBRC  text
    FORM f_read_datum1  TABLES   p_t_res_head STRUCTURE ypp_res_head
                        USING    p_p_file1
                        CHANGING p_w_subrc.
      DATA : iexcel LIKE zexcel_read OCCURS 0 WITH HEADER LINE.
      CLEAR  p_w_subrc.
      CALL FUNCTION 'ZALSM_EXCEL_TO_INTERNAL_TABLE'
        EXPORTING
          filename                = p_p_file1
          i_begin_col             = 1
          i_begin_row             = 1
          i_end_col               = 62
          i_end_row               = 50000
        TABLES
          intern                  = iexcel
        EXCEPTIONS
          inconsistent_parameters = 1
          upload_ole              = 2
          OTHERS                  = 3.
      IF sy-subrc <> 0.
        p_w_subrc = 0 .
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
      LOOP AT iexcel WHERE row > 2.
        IF iexcel-col = '0001'.
          p_t_res_head-type = iexcel-value.
        ENDIF.
        IF iexcel-col = '0002'.
          p_t_res_head-name = iexcel-value.
        ENDIF.
        IF iexcel-col = '0003'.
          p_t_res_head-vrsioid = iexcel-value.
        ENDIF.
        IF iexcel-col = '0004'.
          p_t_res_head-restype = iexcel-value.
        ENDIF.
        IF iexcel-col = '0005'.
          p_t_res_head-locno = iexcel-value.
        ENDIF.
        IF iexcel-col = '0006'.
          p_t_res_head-tzone = iexcel-value.
        ENDIF.
        IF iexcel-col = '0007'.
          p_t_res_head-calendar = iexcel-value.
        ENDIF.
        IF iexcel-col = '0008'.
          p_t_res_head-planner = iexcel-value.
        ENDIF.
        IF iexcel-col = '0009'.
          p_t_res_h

  • Please give me some sample program releated BOM

    please give me some sample program releated BOM

    Hi,
    *& Module : PP                                                         |
    *& Application : The program loads the Bill of Material                |
    *&                                                                     |
    *| Modification Log                                                    |
    *| -
                                                        |
    *| Programmer                                                          |
    *|                                                       Change        |
    *| -
    |
    REPORT zpp0120 NO STANDARD PAGE HEADING
                                      MESSAGE-ID z0
                                      LINE-SIZE  132
                                      LINE-COUNT 65(2).
                         Internal Tables                                 *
    *Internal table for the BOM file.
    DATA: BEGIN OF i_bom OCCURS 0,
          matnr(18),
          werks(4),
          stlan(1),
          stlal(2),
          stktx(40),
          bmeng(16),
          menge(16),
          posnr(4),
          postp(1),
          meins(3),
          datuv(10),
          fmeng(1),
          idnrk(18),
          potx1(40),
          ausch(7),
          END OF i_bom.
    Extracting Document and Doc type for POSTP = D.
    DATA : BEGIN OF i_stpo OCCURS 1,
           doknr(25),
           dokar(3),
           posnr(4),
           stlnr LIKE mast-stlnr,
           END   OF i_stpo.
    Local work area
    DATA:  g_my_rec_in   LIKE i_bom.
    Declare internal table for Call Transaction and BDC Session
    DATA: i_bdc_table LIKE bdcdata OCCURS 0 WITH HEADER LINE.
                         Global Variables                                *
    DATA: g_counter(2) TYPE n,
          g_field_name(18) TYPE c,
          zc_yes  TYPE syftype VALUE 'X'.
                         Selection Screen                                *
    SELECTION-SCREEN BEGIN OF BLOCK a WITH FRAME TITLE text-001.
    PARAMETERS: p_fname1 TYPE localfile .
    SELECTION-SCREEN SKIP 1.
    SELECTION-SCREEN BEGIN OF BLOCK b WITH FRAME TITLE text-002.
    PARAMETERS: p_rloc1 AS CHECKBOX  DEFAULT 'X'.
    SELECTION-SCREEN BEGIN OF BLOCK c WITH FRAME TITLE text-005.
    PARAMETERS p_group(12) OBLIGATORY DEFAULT 'ZBOM'.
    SELECTION-SCREEN END OF BLOCK c.
    SELECTION-SCREEN END OF BLOCK b.
    SELECTION-SCREEN END OF BLOCK a.
    **WRITE the report header
    TOP-OF-PAGE.
      INCLUDE zheading.
                         Start of selection                              *
    START-OF-SELECTION.
    Load Input file
      PERFORM f_load_input_file.
    Create BDC records.
      PERFORM create_bdc_records .
    *&      Form  Create_BDC_records
          text:* perform the BDC for the records in the internal table
    -->  p1        text
    <--  p2        text
    FORM create_bdc_records .
      DATA: v_stlnr LIKE mast-stlnr.
      DATA: v_postp(1) VALUE 'D'.
      IF NOT i_bom[] IS INITIAL.
    Open BDC session
        PERFORM open_bdc_session.
        SORT i_bom BY matnr werks posnr.
        SELECT  SINGLE stlnr  INTO v_stlnr
        FROM mast
        WHERE    matnr = i_bom-matnr
         AND     werks = i_bom-werks.
        SELECT doknr dokar posnr stlnr
                    INTO TABLE i_stpo
                    FROM stpo
                    FOR ALL ENTRIES IN i_bom
                    WHERE postp = v_postp
                    AND   posnr = i_bom-posnr
                    AND   stlnr = v_stlnr.
        SORT i_stpo BY posnr stlnr.
        LOOP AT i_bom.
          g_my_rec_in = i_bom.
          READ TABLE i_stpo WITH KEY posnr = i_bom-posnr
                                     stlnr = v_stlnr
                                     BINARY SEARCH.
          AT NEW matnr.
            CLEAR i_bdc_table[].
            PERFORM insert_screen_header.
          ENDAT.
    Setting up counter for 20 line items
          IF g_counter = 20.
            g_counter = 1.
          ENDIF.
          PERFORM bdc_field  USING 'BDC_OKCODE'
                                        '/00'.
    *next screen
          PERFORM bdc_dynpro USING 'SAPLCSDI' '0140'.
          PERFORM bdc_field  USING 'BDC_CURSOR' 'RC29P-FMENG(01)'.
          PERFORM bdc_field  USING 'BDC_OKCODE' '/00'.
          CONCATENATE 'RC29P-POSNR('  g_counter  ')' INTO g_field_name.
          PERFORM bdc_field USING g_field_name i_bom-posnr.
          CONCATENATE 'RC29P-IDNRK('  g_counter  ')' INTO g_field_name.
          PERFORM bdc_field USING g_field_name i_bom-idnrk.
          CONCATENATE 'RC29P-MENGE('  g_counter  ')' INTO g_field_name.
          PERFORM bdc_field USING g_field_name i_bom-menge.
          CONCATENATE 'RC29P-MEINS('  g_counter  ')' INTO g_field_name.
          PERFORM bdc_field USING g_field_name i_bom-meins.
          CONCATENATE 'RC29P-POSTP('  g_counter  ')' INTO g_field_name.
          PERFORM bdc_field USING g_field_name i_bom-postp.
          CONCATENATE 'RC29P-FMENG('  g_counter  ')' INTO g_field_name.
          PERFORM bdc_field USING g_field_name i_bom-fmeng.
    *next screen
          PERFORM bdc_dynpro USING 'SAPLCSDI' '0130'.
          PERFORM bdc_field  USING 'BDC_OKCODE' '/00'.
    Check the Item category to direct the screen flow accordingly.
          CASE i_bom-postp.
            WHEN 'B'.
              PERFORM item_text_insert.
            WHEN 'Z'.
              PERFORM item_text_insert.
            WHEN 'T'.
              PERFORM item_text_insert.
            WHEN 'N'.
              PERFORM bdc_field   USING 'BDC_CURSOR' 'RC29P-AUSCH'.
              PERFORM bdc_field   USING 'RC29P-AUSCH' i_bom-ausch.
    next screen
              PERFORM item_text_insert.
    *next screen
              PERFORM bdc_dynpro  USING 'SAPLCSDI' '0133'.
              PERFORM bdc_field   USING 'BDC_OKCODE' '/00'.
              PERFORM bdc_field   USING 'RC29P-EKORG' ' '.
            WHEN 'D'.
              PERFORM bdc_field   USING 'RC29P-DOKNR' i_stpo-doknr.
              PERFORM bdc_field   USING 'RC29P-DOKAR' i_stpo-dokar.
    next screen
              PERFORM item_text_insert.
    When POSTP = X, L.
            WHEN OTHERS.
              PERFORM bdc_field   USING 'BDC_CURSOR' 'RC29P-AUSCH'.
              PERFORM bdc_field   USING 'RC29P-AUSCH' i_bom-ausch.
    next screen
              PERFORM item_text_insert.
          ENDCASE.
          g_counter = g_counter + 1.
    next screen
          PERFORM bdc_dynpro      USING 'SAPLCSDI' '0140'.
          PERFORM bdc_field       USING 'BDC_CURSOR' 'RC29P-POSNR(01)'.
          PERFORM bdc_field       USING 'BDC_OKCODE' '=FCBU'.
          AT END OF matnr.
            PERFORM insert_bdc_new.
          ENDAT.
        ENDLOOP.
        CLEAR i_bom[].
        PERFORM close_bdc_session.
    Release the BDC sessions created
        PERFORM release_bdc.
      ENDIF.
    ENDFORM.                    " open_group
    *&      Form  bdc_dynpro_start
          Initialize the screen
         -->P_G_PROGRAM_1
         -->P_G_SCREEN
    FORM bdc_dynpro USING    p_g_program_1
                                    p_g_screen.
      CLEAR i_bdc_table.
      i_bdc_table-program  = p_g_program_1.
      i_bdc_table-dynpro   = p_g_screen.
      i_bdc_table-dynbegin = 'X'.
      APPEND i_bdc_table.
    ENDFORM.                    " bdc_dynpro_start
    *&      Form  bdc_field
           Insert field                                                  *
    FORM bdc_field USING f_name f_value.
      CLEAR i_bdc_table.
      i_bdc_table-fnam = f_name.
      i_bdc_table-fval = f_value.
      APPEND i_bdc_table.
    ENDFORM.                    "bdc_insert_field
    *&      Form  open_bdc_session
         Open the BDC session
    FORM open_bdc_session .
    Open BDC session and creat and update condition records
      CALL FUNCTION 'BDC_OPEN_GROUP'
        EXPORTING
          client                    = sy-mandt
          DEST                      = FILLER8
          group                     = p_group
          HOLDDATE                  = FILLER8
          keep                      = 'X'
          user                      = sy-uname
          RECORD                    = FILLER1
          PROG                      = SY-CPROG
        IMPORTING
          QID                       =
    EXCEPTIONS
       client_invalid            = 1
       destination_invalid       = 2
       group_invalid             = 3
       group_is_locked           = 4
       holddate_invalid          = 5
       internal_error            = 6
       queue_error               = 7
       running                   = 8
       system_lock_error         = 9
       user_invalid              = 10
       OTHERS                    = 11
      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.                    " create_bdc_session
    *&      Form  insert_screen_header
          Insert the Header data into the screens
    FORM insert_screen_header .
      g_counter = 1.
      PERFORM bdc_dynpro USING 'SAPLCSDI' '0100'.
      PERFORM bdc_field  USING 'BDC_CURSOR' 'RC29N-STLAL'.
      PERFORM bdc_field  USING 'BDC_OKCODE' '/00'.
      PERFORM bdc_field  USING 'RC29N-MATNR' g_my_rec_in-matnr.
      PERFORM bdc_field  USING 'RC29N-WERKS' g_my_rec_in-werks.
      PERFORM bdc_field  USING 'RC29N-STLAN' g_my_rec_in-stlan.
      PERFORM bdc_field  USING 'RC29N-STLAL' g_my_rec_in-stlal.
      PERFORM bdc_field  USING 'RC29N-DATUV' g_my_rec_in-datuv.
    next screen
      PERFORM bdc_dynpro USING 'SAPLCSDI' '0110'.
      PERFORM bdc_field  USING 'BDC_CURSOR' 'RC29K-BMENG'.
      PERFORM bdc_field  USING 'BDC_OKCODE' '/00'.
      PERFORM bdc_field  USING 'RC29K-STKTX' g_my_rec_in-stktx.
      PERFORM bdc_field  USING 'RC29K-BMENG' g_my_rec_in-bmeng.
    *next screen
      PERFORM bdc_dynpro USING 'SAPLCSDI' '0111'.
      PERFORM bdc_field  USING 'BDC_CURSOR' 'RC29K-LABOR'.
    ENDFORM.                    " insert_screen_header
    *&      Form  insert_bdc
         Insert the BDC session
    FORM insert_bdc_new .
      CALL FUNCTION 'BDC_INSERT'
         EXPORTING
           tcode                  = 'CS01'
          POST_LOCAL             = NOVBLOCAL
          PRINTING               = NOPRINT
          SIMUBATCH              = ' '
          CTUPARAMS              = ' '
         TABLES
           dynprotab              = i_bdc_table
      EXCEPTIONS
        internal_error         = 1
        not_open               = 2
        queue_error            = 3
        tcode_invalid          = 4
        printing_invalid       = 5
        posting_invalid        = 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.
      CLEAR i_bdc_table[].
    ENDFORM.                    " insert_bdc
    *&      Form  close_bdc_session
          Close the BDC session
    FORM close_bdc_session .
      CALL FUNCTION 'BDC_CLOSE_GROUP'
           EXCEPTIONS
                not_open    = 1
                queue_error = 2
                OTHERS      = 3.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    ENDFORM.                    " close_bdc_session
    *&      Form  f_load_input_file
         Load the file into the Internal table
    FORM f_load_input_file.
      IF p_rloc1 = zc_yes.
        CALL FUNCTION 'WS_UPLOAD'
             EXPORTING
                  filename                = p_fname1
                  filetype                = 'DAT'
             TABLES
                  data_tab                = i_bom
             EXCEPTIONS
                  conversion_error        = 1
                  file_open_error         = 2
                  file_read_error         = 3
                  invalid_type            = 4
                  no_batch                = 5
                  unknown_error           = 6
                  invalid_table_width     = 7
                  gui_refuse_filetransfer = 8
                  customer_error          = 9
                  OTHERS                  = 10.
        IF sy-subrc <> 0.
          MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                  WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
          STOP.
        ENDIF.
      ENDIF.
    ENDFORM.                    " f_load_input_file
    *&      Form  release_bdc
         Release BDC session
    FORM release_bdc.
      SUBMIT rsbdcsub WITH mappe EQ p_group
                      WITH von EQ sy-datum
                      WITH bis EQ sy-datum
                      WITH fehler EQ '.'
                      EXPORTING LIST TO MEMORY
                      AND RETURN.
    ENDFORM.                    " release_bdc
    *&      Form  item_text_insert
          Repetitive code in the screen flow
    FORM item_text_insert.
      PERFORM bdc_dynpro USING 'SAPLCSDI' '0131'.
      PERFORM bdc_field  USING 'BDC_OKCODE' '/00'.
      PERFORM bdc_field  USING 'BDC_CURSOR' 'RC29P-POTX1'.
      PERFORM bdc_field  USING 'RC29P-POTX1' i_bom-potx1.
    ENDFORM.                    " item_text_insert

  • Hi All! I want to use javaFX controles in vaadin applications pls give some sample code

    Hi All!
    I want to use javaFX 2.0 Controles in Vaadin applications please give some sample code.
    Is it possible or not .
    Regards

    Hi,
    Thanks manish for your reply but i could not get any help from your suggesion because i have know idea in Java.
    I want to know how can we deploy jsp files in Oracle bpel.
    Because i'm not getting the proper way to deploy jsp files in oracle bpel.
    Can any one help me out by providing step by step information or suggest any url to resolve this.
    Regards,
    Nikhil Kumar Jain

  • Please send me some good links on System Function Calls

    Hi,
    I want to know more about System Function calls. Please send me some good links on the same.
    Eg : CALL 'C_DIR_READ_NEXT'
          ID 'TYPE'   FIELD file-type
          ID 'NAME'   FIELD file-name
          ID 'LEN'    FIELD file-len
          ID 'OWNER'  FIELD file-owner
          ID 'MTIME'  FIELD file-mtime
          ID 'MODE'   FIELD file-mode
          ID 'ERRNO'  FIELD file-errno
          ID 'ERRMSG' FIELD file-errmsg.
    Rgds,
    Raghavendra.

    Hi,
    <u><b>CALL - Call a System Function:</b></u>
    <b>Note</b>
    This statement is for internal use only.
    It cannot be used in application programs.
    As of Release 6.20, you should use Kernel Methods instead of system functions.
    <b>Syntax</b>
    CALL cfunc.
    Addition:
    ... ID id1 FIELD f1 ... ID idn FIELD fn
    <b>Effect</b>
    Calls the system function cfunc. The relevant function must exist in the file sapactab.h. If you change or recreate a function, you have to compile and link the SAP kernel again. For this, you need the C source code files.
    Normally, external programs should be called by RFC with CALL FUNCTION ... DESTINATION.
    <b>Addition</b>
    ... ID id1 FIELD f1 ... ID idn FIELD fn
    <b>Effect</b>
    Passes fields to the called program by reference. With "ID id1", you specify the name of a formal parameter, and with "FIELD f1" the relevant field from the ABAP/4 program. If a formal parameter expects an internal table, the latter is passed in the form "FIELD tab[]".
    Example
    DATA RESULT(8).
    CALL 'MULTIPLY' ID 'P1'  FIELD '9999'
                    ID 'P2'  FIELD '9999'
                    ID 'RES' FIELD RESULT.
    <b>Note</b>
    With some critical C functions, the system automatically performs an authorization check. If the user does not have the appropriate authorization, a runtime error occurs. You can check the authorization with the function module AUTHORITY_CHECK_C_FUNCTION.
    <b>Exceptions</b>
    Non-Catchable Exceptions
    Cause: You do not have the authorization to call this C function.
    Runtime Error: CALL_C_FUNCTION_NO_AUTHORITY
    Cause: The system function specified is unknown.
    Runtime Error: CALL_C_FUNCTION_NOT_FOUND
    Cause: The system function SYSTEM is deactivated (in CALL 'SYSTEM')
    Runtime Error: CALL_SYSTEM_DISABLED
    Regards,
    Bhaskar

  • Please send me some interview quetions in ALE /IDOC's

    please send me some interview qutions in ALE /IDOC'c  it will help me a lot

    Hi
    just vivsit this sdn link you will get all the interview questions
    The specified item was not found.
    thanks.
    reward if helpful
    vivekanand

  • I just need a little help to connect with eCommerce API. Could anyone please give a JAVA sample code

    Hi All,
    I am looking for a sample code to just to connect with Business Catalyst eCommerce API. My aim is to simply retirieve the list of the products and update them.
    It would be really helpful, if anyone please provide me a sample code in JAVA, just to connect with the API.
    Thanks
    Ani

    public static void main(String[] args) throws RemoteException, MalformedURLException {
                        String endpoint = "https://CC.sys.com/CatalystWebS1ervice/CatalystEcommerceWebservice.asmx?WSDL"; // endpoint url can be found under Site Settings -> API -> click on eCommerce and copy the URL on the browser here.
                        CatalystEcommerceWebserviceSoapProxy sq = new CatalystEcommerceWebserviceSoapProxy(endpoint);
                        Products[] prod = new Products[2];
                        prod = sq.product_ListRetrieve(Username , Password, SiteID, CatalogueID);
                        System.out.println(prod[1].getDescription());

Maybe you are looking for

  • Is it possible to add a graphics card to the back of my HP

    Hello  I want to know if it's possible to add a new graphics card to the back of a Laptop not inside of it but on the back of my laptop ???  my graphics Card is a Intel 4000 graphics card is a terrible for gaming TERRIBLE !!!  

  • Wifi suddenly not working with new networks?

    This is already my second iPhone 5, since the last went into warranty because, ironically, of a wifi problem. The other day, I was just minding my own business when I decided to try to connect to the local wifi of the place I was at the time, and it

  • Two finger click and control click no longer works in Finder

    Starting today, I can't do a two finger click or a control click to bring up the contextual menu on a file or folder. Two finger click works everywhere else on my Macbook, the desktop, browsers, Office apps, everywhere except Finder. I'm running OSX

  • Oracle 11gR2 RAC - SCAN issue

    We have Oracle 11gR2(11.2.0.1) RAC (2-node) on HP-UX. And we have some issue with SCAN Listener configuration. Issue-1* LISTENER_SCAN1 is running on node-1 and LISTENER_SCAN2 & LISTENER_SCAN3 is running on node-2. This is how it's running always. And

  • How do i store value into my itunes account?

    i have never used an itunes music store gift certificate before, in fact i only made one purchase in itunes before, and that was because i was just playing with my itunes setting and didn't know there was no final confirmation stage to cancel a purch