Example for gui_upload.......

Hi friends,
I want to upload CSV file into Database table using CL_gui_frontend_services=>File_open_dialog and
CL_gui_frontend_services=>gui_download.
friends Please give me a example?
Regards,
Srikanth

Hi,
Please refer to the code below :
report ZTESTGL_OPEN_BAL
       no standard page heading line-size 255.
data : begin of itab1 occurs 0,
        values(1000) type c,
       end of itab1.
DATA :  V_COUNT TYPE I.
DATA :     V_BLDAT(10) TYPE C,
           V_BLART(2) TYPE C,
           V_BUKRS(4) TYPE C,
           V_BUDAT(10) TYPE C,
           V_MONAT(2) TYPE C,
           V_WAERS(5) TYPE C,
           V_NEWBS(2) TYPE C,
           V_NEWKO(17) TYPE C,
           V_WRBTR(13) TYPE C,
           V_SGTXT(50) type c,
           V_GSBER(4) TYPE C,
           V_KOSTL(10) TYPE C,
           V_AUFNR(10) TYPE C.
data : begin of itab occurs 0,
           BLDAT(10) TYPE C,
           BLART(2) TYPE C,
           BUKRS(4) TYPE C,
           BUDAT(10) TYPE C,
           MONAT(2) TYPE C,
           WAERS(5) TYPE C,
           NEWBS(2) TYPE C,
           NEWKO(17) TYPE C,
           WRBTR(13) TYPE C,
           SGTXT(50) TYPE C,
           GSBER(4) TYPE C,
           KOSTL(10) TYPE C,
           AUFNR(10) TYPE C,
           TNEWBS(2) TYPE C,
           TNEWKO(17) TYPE C,
           TWRBTR(13) TYPE C,
       end of itab.
data : i_bdcdata like bdcdata occurs 0 with header line.
PARAMETERS : p_file LIKE rlgrap-filename OBLIGATORY.
DATA : filename TYPE string.
DATA : w_textout LIKE t100-text.
DATA: BEGIN OF messtab OCCURS 0.
        INCLUDE STRUCTURE bdcmsgcoll.
DATA: END OF messtab.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
  CLEAR p_file.
  CALL FUNCTION 'F4_FILENAME'
    IMPORTING
      file_name = p_file.
start-of-selection.
  filename = p_file.
  CALL FUNCTION 'GUI_UPLOAD'
    EXPORTING
     FILENAME                      = filename
     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            =
* IMPORTING
*   FILELENGTH                    =
*   HEADER                        =
    TABLES
      DATA_TAB                      = itab1
* 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
  V_COUNT = 1.
  LOOP AT ITAB1.
    IF V_COUNT = 1.
      SPLIT ITAB1 AT ',' INTO ITAB-BLDAT ITAB-BLART ITAB-BUKRS ITAB-BUDAT ITAB-MONAT
                         ITAB-WAERS ITAB-NEWBS ITAB-NEWKO ITAB-WRBTR ITAB-SGTXT ITAB-GSBER ITAB-KOSTL ITAB-AUFNR.
*    APPEND ITAB.
    ELSEIF V_COUNT = 2.
      SPLIT ITAB1 AT ',' INTO V_BLDAT V_BLART V_BUKRS V_BUDAT V_MONAT
                        V_WAERS ITAB-TNEWBS ITAB-TNEWKO ITAB-TWRBTR ITAB-SGTXT V_GSBER V_KOSTL V_AUFNR.
      APPEND ITAB.
    ENDIF.
    V_COUNT = V_COUNT + 1.
    IF V_COUNT = 3.
      v_count = 1.
    ENDIF.
  ENDLOOP.
  V_COUNT = 1 .
  LOOP AT ITAB.
    REFRESH i_BDCDATA.
    perform bdc_dynpro      using 'SAPMF05A' '0100'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RF05A-NEWKO'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'BKPF-BLDAT'
                                  ITAB-BLDAT.
    perform bdc_field       using 'BKPF-BLART'
                                  ITAB-BLART.
    perform bdc_field       using 'BKPF-BUKRS'
                                  ITAB-BUKRS.
    perform bdc_field       using 'BKPF-BUDAT'
                                  ITAB-BUDAT.
    perform bdc_field       using 'BKPF-MONAT'
                                  ITAB-MONAT.
    perform bdc_field       using 'BKPF-WAERS'
                                  ITAB-WAERS.
    perform bdc_field       using 'FS006-DOCID'
    perform bdc_field       using 'RF05A-NEWBS'
                                  ITAB-NEWBS.
    perform bdc_field       using 'RF05A-NEWKO'
                                  ITAB-NEWKO.
    perform bdc_dynpro      using 'SAPMF05A' '0300'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'BSEG-WRBTR'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'BSEG-WRBTR'
                                  ITAB-WRBTR.
    perform bdc_field       using 'BSEG-SGTXT' "Delete  SGTXT if not works properly
                                  ITAB-SGTXT.
    perform bdc_dynpro      using 'SAPLKACB' '0002'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'COBL-GSBER'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=ENTE'.
    perform bdc_field       using 'COBL-GSBER'
                                  ITAB-GSBER.
    perform bdc_field       using 'COBL-KOSTL'
                                  ITAB-KOSTL.
    perform bdc_field       using 'COBL-AUFNR'
                                  ITAB-AUFNR.
    perform bdc_dynpro      using 'SAPMF05A' '0300'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RF05A-NEWKO'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'BSEG-WRBTR'
                                  ITAB-WRBTR.
    perform bdc_field       using 'RF05A-NEWBS'
                                  ITAB-TNEWBS.
    perform bdc_field       using 'RF05A-NEWKO'
                                  ITAB-TNEWKO.
    perform bdc_field       using 'DKACB-FMORE'
                                  'X'.
    perform bdc_dynpro      using 'SAPLKACB' '0002'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'COBL-GSBER'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=ENTE'.
    perform bdc_field       using 'COBL-GSBER'
                                  ITAB-GSBER.
    perform bdc_dynpro      using 'SAPMF05A' '0300'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'BSEG-WRBTR'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'BSEG-WRBTR'
                                  ITAB-WRBTR.
*    perform bdc_field       using 'BSEG-MWSKZ'
*                                  'F0'.
    perform bdc_dynpro      using 'SAPLKACB' '0002'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'COBL-GSBER'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=ENTE'.
    perform bdc_field       using 'COBL-GSBER'
                                  ITAB-GSBER.
    perform bdc_dynpro      using 'SAPMF05A' '0300'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'BSEG-WRBTR'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=BU'.
    perform bdc_field       using 'BSEG-WRBTR'
                                  ITAB-TWRBTR.
*    perform bdc_field       using 'BSEG-MWSKZ'
*                                  'F0'.
    perform bdc_field       using 'BSEG-SGTXT' "Delete  SGTXT if not works properly
                                  ITAB-SGTXT.
    perform bdc_field       using 'DKACB-FMORE'
                                  'X'.
    perform bdc_dynpro      using 'SAPLKACB' '0002'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'COBL-GSBER'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=ENTE'.
    perform bdc_field       using 'COBL-GSBER'
                                  ITAB-GSBER.
    CALL TRANSACTION 'F-02' USING I_BDCDATA
                       MODE  'a'
                       UPDATE 'S'.
  ENDLOOP.
  IF SY-SUBRC NE 0.
    LOOP AT messtab WHERE msgtyp = 'E'.
      CALL FUNCTION 'MESSAGE_TEXT_BUILD'
        EXPORTING
          msgid               = messtab-msgid
          msgnr               = messtab-msgnr
          msgv1               = messtab-msgv1
          msgv2               = messtab-msgv2
          msgv3               = messtab-msgv3
          msgv4               = messtab-msgv4
        IMPORTING
          message_text_output = w_textout.
      write : / w_textout.
    ENDLOOP.
  ENDIF.
*&      Form  BDC_DYNPRO
*       text
*      -->PROGRAM    text
*      -->DYNPRO     text
FORM BDC_DYNPRO USING PROGRAM DYNPRO.
  CLEAR I_BDCDATA.
  I_BDCDATA-PROGRAM  = PROGRAM.
  I_BDCDATA-DYNPRO   = DYNPRO.
  I_BDCDATA-DYNBEGIN = 'X'.
  APPEND i_BDCDATA.
ENDFORM.                    "BDC_DYNPRO
*&      Form  BDC_FIELD
*       text
*      -->FNAM       text
*      -->FVAL       text
FORM BDC_FIELD USING FNAM FVAL.
  CLEAR i_BDCDATA.
  I_BDCDATA-FNAM = FNAM.
  I_BDCDATA-FVAL = FVAL.
  APPEND i_BDCDATA.
ENDFORM.                    "BDC_FIELD
Thanks,
Sriram Ponna.

Similar Messages

  • Example for Using WDR_SELECT_OPTIONS and SALV_WD_TABLE in one View

    Hello,
    I need an Example for Using the WD-Components WDR_SELECT_OPTIONS and SALV_WD_TABLE
    in one view. Can anybody help me?
    Thanks
    Toto

    Hello,
    Please see these:
    [https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/3439404a-0801-0010-dda5-8c14514d690d]
    [https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/21706b4b-0901-0010-7d93-c93b6394bc1d]
    [https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/media/uuid/39c54fe7-0b01-0010-0eb6-d63ac2bdd637]
    [/people/rich.heilman2/blog/2005/12/20/using-select-options-in-a-web-dynproabap-application]
    [/people/thomas.jung3/blog/2005/12/21/webdynpro-abap-alv]
    [https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/3133474a-0801-0010-d692-81827814a5a1]
    [https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/bd28494a-0801-0010-45a3-fc359d82d3e8]
    Regards.

  • Could u plz help me to find simple example for how to save data file in a spread sheet or any other way in the real time controller for Sbrio 9642 using memory or usb flash memory

    Could u plz help me to find simple example for how to save data file in a spread sheet or any other way in the real time controller for Sbrio 9642 using memory or usb flash memory

    Here are a few Links to a helpful Knowledge Base article and a White Paper that should help you out: http://digital.ni.com/public.nsf/allkb/BBCAD1AB08F1B6BB8625741F0082C2AF and http://www.ni.com/white-paper/10435/en/ . The methods for File IO in Real Time are the same for all of the Real Time Targets. The White Paper has best practices for the File IO and goes over how to do it. 
    Alex D
    Applications Engineer
    National Instruments

  • Example for 4 or 3 level Hierarchail Seq ALV report?

    i need the example for 4 or 3 level heirarchial sequential ALV report. ?

    Hi,
    Hierarchail Seq ALV may not support 3rd 4th levels.For this type of requirement you may go to tree report.
    Refer the below links for tree report.
    [http://www.****************/Tutorials/ALV/ALVTreeDemo/demo.htm|http://www.****************/Tutorials/ALV/ALVTreeDemo/demo.htm]
    DWDM -  transaction for sample/demo programs for controls
    sample Program
    BCALV_TREE_01                  ALV Tree Control: Build Up the Hierarchy Tree
    BCALV_TREE_02                  ALV Tree Control: Event Handling
    BCALV_TREE_03                  ALV Tree Control: Use an Own Context Menu
    BCALV_TREE_04                  ALV Tree Control: Add a Button to the Toolbar
    BCALV_TREE_05                  ALV Tree Control: Add a Menu to the Toolbar
    BCALV_TREE_06                  ALV tree control: Icon column and icon for nodes/items
    BCALV_TREE_DEMO                Demo for ALV tree control
    BCALV_TREE_DND                 ALV tree control: Drag & Drop within a hierarchy tree
    BCALV_TREE_DND_MULTIPLE        ALV tree control: Drag & Drop within a hierarchy tree
    BCALV_TREE_EVENT_RECEIVER      Include BCALV_TREE_EVENT_RECEIVER
    BCALV_TREE_EVENT_RECEIVER01
    BCALV_TREE_ITEMLAYOUT          ALV Tree: Change Item Layouts at Runtime
    BCALV_TREE_MOVE_NODE_TEST      Demo for ALV tree control
    BCALV_TREE_SIMPLE_DEMO         Program BCALV_TREE_SIMPLE_DEMO
    BCALV_TREE_VERIFY              Verifier for ALV Tree and Simple ALV Tree
    Reward if found helpful.
    Regards,
    Boobalan Suburaj

  • PAPI Web Service (PAPI-WS) Example for Oracle BPM Studio

    Here is the location of a step-by-step explanation on how to use PAPI Web Service (PAPI-WS) to create a work item instance and then run the instance inside an activity in a process running on Oracle BPM Studio.
    http://www.4shared.com/file/128256802/f20abc7a/PAPI-WS_for_Oracle_BPM_Studio.html
    Be sure to use the project that is in the zip file for this example.
    If you need an example of how to use PAPI-WS on Oracle BPM Enterprise, go to this thread: PAPI Web Service (PAPI-WS) Example for Oracle BPM Enterprise Standalone
    If you need a step-by-step example of how to use PAPI (the Java API) go to this thread: Creating a new work item instance in a process using PAPI
    Hope this helps,
    Dan

    Hi,
    Is there any sample code showing PAPI-WS with VS 2008? AFAIK, there is a sample using VS 2005 and WSE 3.0, but I'm interested in using VS 2008/WCF.
    Regards,

  • PAPI Web Service (PAPI-WS) Example for Oracle BPM Enterprise Standalone

    Here is the location of a step-by-step explanation on how to use PAPI Web Service (PAPI-WS) to create a work item instance and then run the instance inside an activity in a process running on Oracle BPM Enterprise Standalone.
    http://www.4shared.com/file/128249957/9bd6ef61/PAPI-WS_for_Oracle_BPM_Standalone.html
    Be sure to use the project that is in the zip file for this example.
    To see how to invoke PAPI-WS when using Oracle BPM Studio, go to this thread: PAPI Web Service (PAPI-WS) Example for Oracle BPM Studio
    If you need a step-by-step example of how to use PAPI (the Java API) go to this thread: Creating a new work item instance in a process using PAPI
    Hope this helps,
    Dan

    Dan,
    I tried in both studio and Standalone.
    From Studio :*
    1. The Url for the Webservice is (http://localhost:8585/papiws/PapiWebServiceEndpoint?wsdl). From studio by default port number was 8585.From this studio wsdl URL(http://localhost:8585/papiws/PapiWebServiceEndpoint?wsdl),I did n't see any wsdl text in the browser.
    From Standalone :*
    1. In BPM Admin Center, I have selected *"PAPI Web Services"* check box(Page 5 of your document).
    2. In The BPM Admin Center, I have clicked on *"Start BPM Web Applications"*.
    3. After Stand alone server started *"Launch PAPI WebServices Console"* link was enabled,And I clicked on that link.It opened a browser with URL (http://localhost:8686/papiws/PapiWebService)
    Oracle® BPM PAPI Web Services
    Service Name 'PapiWebService'
    Style: Document Literal Wrapped
    SSO Enabled: false
    WS-Security UsernameToken Profile Authentication Enabled: false
    HTTP Basic Authentication Enabled: true
    Preset Authentication Enabled: false
    MTOM Optimization for attachments Enabled*: false
    Endpoint: http://localhost:8686/papiws/PapiWebServiceEndpoint
    WSDL: http://localhost:8686/papiws/PapiWebServiceEndpoint?wsdl
    I have copied wsdl URL(http://localhost:8686/papiws/PapiWebServiceEndpoint?wsdl) and pasted it into a browser's URL field.I did n't see any wsdl text in the browser,but I see following error
    HTTP Status 404 - Servlet PapiWebServiceServlet is not available
    type Status report
    message Servlet PapiWebServiceServlet is not available
    description The requested resource (Servlet PapiWebServiceServlet is not available) is not available.
    Apache Tomcat/5.5.15
    Edited by: Prabhasankar on Dec 24, 2010 9:10 AM

  • Example for LVUserEvent

    Hi,
    I am looking for examples for using LVUserEvent.
    In found this:
    http://zone.ni.com/devzone/cda/epd/p/id/1480
    but the zip-archive is not including any vi, only c-code and the dll, so I have difficulties to understand how it works.
    I am looking for examples, how to fire events from my VisualStudio2005 C-DLL to labview evebt structure.
    Werner

    huerttlen wrote:
    Your 3rd example is exactly the one, I am missing the vi in the zip: where do I find the vi to play with this ?
    There is only one LLB in that zip file. Attaching here.
    Mathan
    Attachments:
    LVUserEvent.llb ‏38 KB

  • Example for loading a csv file into diadem from a labview application

    Hi everyone, i'm using labview 8.2 and DIAdem 10.1.
    I've been searching in NI example finder but I had no luck so far.
    I have already downloaded the labview connectivity VIs.
    Can anyone provide a example that can help me loading a csv file into diadem from a labview application?
    Thanks

    Hi Alexandre.
    I attach an example for you.
    Best Regards.
    Message Edité par R_Duval le 01-15-2008 02:44 PM
    Romain D.
    National Instruments France
    #adMrkt{text-align: center;font-size:11px; font-weight: bold;} #adMrkt a {text-decoration: none;} #adMrkt a:hover{font-size: 9px;} #adMrkt a span{display: none;} #adMrkt a:hover span{display: block;}
    NIDays 2010 : Conférence mondiale de l'instrumentation virtuelle
    >>Détails et Inscription<<
    Attachments:
    Classeur1.csv ‏1 KB
    Load CSV to Diadem.vi ‏15 KB

  • Syntax errors in examples for UTL_LMS

    The examples for UTL_LMS in
    Oracle® Database PL/SQL Packages and Types Reference
    10g Release 2 (10.2)
    Part Number B14258-01
    http://download-uk.oracle.com/docs/cd/B19306_01/appdev.102/b14258/u_lms.htm
    contain syntax errors
    Correct would be
    DECLARE
       s varchar2(200);
       i  pls_integer;
    BEGIN
       i:= utl_lms.get_message(26052, 'rdbms', 'ora', 'french', s);
       dbms_output.put_line('before format, message is: '||s);
       dbms_output.put_line('formatted message is: '||utl_lms.format_message(s, 9, 'my_column_name'));
    END;
    /and
    DECLARE
      s varchar2(200);
      i pls_integer;
    BEGIN
       i:=utl_lms.get_message(601, 'rdbms', 'oci', 'french', s);
       dbms_output.put_line('OCI--00601 is: '||s);
    END;
    /

    Hello Martin,
    This is a known problem with wlst-jython. One cannot catch syntax errors
    programmatically. The only way is to avoid loading properties file
    that may cause syntax errors.
    I am curious though how can a user enter invalid properties via a script?
    thanks,
    -satya
    Martin Gustavsson wrote:
    Hi,
    When there are syntax errors in WLST-script, the calling program will get no information about this.
    In our case the calling program is ANT. If the user enters invalid properties it could cause syntax errors in the WLST script. But the ANT task always receive a successfull code back and doesn't know that it went wrong.
    What is the workaround for this? How can I from WLST return a fail code so that ANT does not continue?
    Regards,
    Martin

  • Hi Experts, need an example for abap unit test(ABAP OO)?

    Hi Experts,
    I want to do abap unit test for the developed programs, could anyone please give me an example program of development(a simple is ok, just use it to test)? and an abap unit test example for the program, what I want is to use object oriented abap, thanks in advance!
    Merry Christmas to you all.
    Kind regards
    Dawson

    Hi
    Below documents will give you more information,
    http://help.sap.com/saphelp_nw04/helpdata/en/a2/8a1b602e858645b8aac1559b638ea4/content.htm
    ABAP Testing and Troubleshooting [original link is broken]
    http://bi.offis.de/publicProject/g16cglafhqva.htm
    regards
    Nagaraju

  • I need code example for server act as client and vice versa

    Hi all,
    I want code example for performing both server and clients using RMI. I mean Server will act as client and client will act as server. So a single program will act as both client and server .
    Please give example, it will helpful to complete my project. I am struggling in this stage. Its like peer to peer action.
    Thanks & Regards
    R.Ragupathi

    1. The tutorial shows you how to do cleint/server.
    2. Search on the topic "callback" to see how cleint and server roles can be reversed.

  • I need the coding example for encapsulation

    hi all
    i need the coding example for encapsulation
    thanks in advance

    hi all
    i need the coding example for encapsulation
    thanks in advanceI see a man, hes trapped on the other side.. what Sam?... yes ... hes wearing a hood, he's a hooded gentleman, perhaps a monk who practised the black arts.... he says... "google for the answer"...

  • I need simple example for alv grid

    hi
    i need code for simple example for alv grid.
    thanks.

    hi bharat,
                  this is report with most of the functionality.
    report zus_alv_demo_grid .
    tables:     ekko.
    type-pools: slis.
    types: begin of t_ekko,
    ebeln type ekpo-ebeln,
    ebelp type ekpo-ebelp,
    statu type ekpo-statu,
    aedat type ekpo-aedat,
    matnr type ekpo-matnr,
    menge type ekpo-menge,
    meins type ekpo-meins,
    netpr type ekpo-netpr,
    peinh type ekpo-peinh,
    line_color(4) type c, "Used to store row color
    end of t_ekko.
    data: it_ekko type standard table of t_ekko initial size 0,
           wa_ekko type t_ekko.
    *ALV data declarations
    data: fieldcatalog type slis_t_fieldcat_alv with header line,
          gd_tab_group type slis_t_sp_group_alv,
          gd_layout    type slis_layout_alv,
          gd_repid     like sy-repid.
    Data declaration for EVENT and PRINT PARAMETER.
    data: gt_events type slis_t_event,
           gd_prntparams type slis_print_alv.
    data declaration for sorting.
    data : it_sortcat   type slis_sortinfo_alv occurs 1,
           wa_sort like line of it_sortcat.
    data :  i_list_comments type slis_t_listheader.
    start-of-selection.
      perform data_retrieval.
    perform user_command.
      perform build_fieldcatalog.
      perform build_layout.
      perform build_events.
      perform build_print_params.
      perform build_sortcat.
      perform display_alv_report.
    end-of-selection.
    *TOP-OF-PAGE.
    PERFORM top-of-page.
    end-of-page.
    *&      Form  build_fieldcatalog
          text
    -->  p1        text
    <--  p2        text
    form build_fieldcatalog.
      fieldcatalog-fieldname   = 'EBELN'.
      fieldcatalog-seltext_m   = 'Purchase Order'.
      fieldcatalog-col_pos     = 0.
      fieldcatalog-outputlen   = 10.
      fieldcatalog-emphasize   = 'X'.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'EBELP'.
      fieldcatalog-seltext_m   = 'PO Item'.
      fieldcatalog-col_pos     = 1.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'STATU'.
      fieldcatalog-seltext_m   = 'Status'.
      fieldcatalog-col_pos     = 2.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'AEDAT'.
      fieldcatalog-seltext_m   = 'Item change date'.
      fieldcatalog-col_pos     = 3.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'MATNR'.
      fieldcatalog-seltext_m   = 'Material Number'.
      fieldcatalog-col_pos     = 4.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'MENGE'.
      fieldcatalog-seltext_m   = 'PO quantity'.
      fieldcatalog-col_pos     = 5.
      fieldcatalog-do_sum = 'X'.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'MEINS'.
      fieldcatalog-seltext_m   = 'Order Unit'.
      fieldcatalog-col_pos     = 6.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'NETPR'.
      fieldcatalog-seltext_m   = 'Net Price'.
      fieldcatalog-col_pos     = 7.
      fieldcatalog-outputlen   = 15.
      fieldcatalog-datatype     = 'CURR'.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'PEINH'.
      fieldcatalog-seltext_m   = 'Price Unit'.
      fieldcatalog-col_pos     = 8.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
    endform.                    " build_fieldcatalog
    *&      Form  build_layout
          text
    -->  p1        text
    <--  p2        text
    form build_layout.
      gd_layout-no_input          = 'X'.
      gd_layout-colwidth_optimize = 'X'.
      gd_layout-totals_text       = 'Totals'(201).
    Set layout field for row attributes(i.e. color)
      gd_layout-info_fieldname =      'LINE_COLOR'.
    gd_layout-totals_only        = 'X'.
    gd_layout-f2code            = 'DISP'.  "Sets fcode for
    *when double
                                            "click(press f2)*
    gd_layout-group_change_edit = 'X'.
    gd_layout-header_text       = 'helllllo'.
    endform.                    " build_layout
    *&      Form  data_retrieval
          text
    -->  p1        text
    <--  p2        text
    form data_retrieval.
      data: ld_color(1) type c.
      select ebeln ebelp statu aedat matnr menge meins netpr
    peinh from ekpo  into table it_ekko.
    *Populate field with color attributes
      loop at it_ekko into wa_ekko.
    Populate color variable with colour properties
    Char 1 = C (This is a color property)
    Char 2 = 3 (Color codes: 1 - 7)
    Char 3 = Intensified on/off ( 1 or 0 )
    Char 4 = Inverse display on/off ( 1 or 0 )
              i.e. wa_ekko-line_color = 'C410'
        ld_color = ld_color + 1.
    Only 7 colours so need to reset color value
        if ld_color = 8.
          ld_color = 1.
        endif.
        concatenate 'C' ld_color '10' into wa_ekko-line_color.
    wa_ekko-line_color = 'C410'.
        modify it_ekko from wa_ekko.
      endloop.
    endform.                    " data_retrieval
    *&      Form  display_alv_report
          text
    -->  p1        text
    <--  p2        text
    form display_alv_report.
      gd_repid = sy-repid.
      call function 'REUSE_ALV_GRID_DISPLAY'
           exporting
                i_callback_program       = gd_repid
                is_layout                = gd_layout
                i_callback_top_of_page   = 'TOP-OF-PAGE'
                i_callback_user_command  = 'USER_COMMAND'
                i_callback_pf_status_set = 'SET_PF_STATUS'
                it_event                 = gt_events
                is_print                 = gd_prntparams
                it_fieldcat              = fieldcatalog[]
                it_sort                 = it_sortcat
                i_save                   = 'X'
           tables
                t_outtab                 = it_ekko
           exceptions
                program_error            = 1
                others                   = 2.
      if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      endif.
    endform.              " DISPLAY_ALV_REPORT
    *&      Form  user_command
          text
    -->  p1        text
    <--  p2        text
    *&      Form  top-of-page
          text
    -->  p1        text
    <--  p2        text
    form top-of-page.
    *ALV Header declarations
      data: t_header type slis_t_listheader,
            wa_header type slis_listheader,
            t_line like wa_header-info,
            ld_lines type i,
            ld_linesc(10) type c.
    Title
      wa_header-typ  = 'H'.
      wa_header-info = 'EKKO Table Report'.
      append wa_header to t_header.
      clear wa_header.
    Date
      wa_header-typ  = 'S'.
      wa_header-key = 'Date: '.
      concatenate  sy-datum+6(2) '.'
                   sy-datum+4(2) '.'
       sy-datum(4) into wa_header-info."todays date
      append wa_header to t_header.
      clear: wa_header.
    Total No. of Records Selected
      describe table it_ekko lines ld_lines.
      ld_linesc = ld_lines.
      concatenate 'Total No. of Records Selected: ' ld_linesc
         into t_line separated by space.
      wa_header-typ  = 'A'.
      wa_header-info = t_line.
      append wa_header to t_header.
      clear: wa_header, t_line.
      call function 'REUSE_ALV_COMMENTARY_WRITE'
           exporting
           it_list_commentary = t_header
           i_logo             = 'GANESH_LOGO'.
    endform.                    " top-of-page
          FORM user_command                                             *
    -->  R_UCOMM                                                       *
    -->  RS_SELFIELD                                                   *
    form user_command using r_ucomm like sy-ucomm
    rs_selfield type slis_selfield.
      case r_ucomm.
        when '&IC1'.
          if rs_selfield-fieldname = 'EBELN'.
            read table it_ekko into wa_ekko index rs_selfield-tabindex.
            set parameter id 'BES' field wa_ekko-ebeln.
            call transaction 'ME23N' and skip first screen.
          endif.
        when 'ULHAS'.
          if rs_selfield-fieldname = 'EBELN'.
            read table it_ekko into wa_ekko index rs_selfield-tabindex.
            set parameter id 'BES' field wa_ekko-ebeln.
            call transaction 'ME23N' and skip first screen.
          endif.
      endcase.
    endform.
          FORM set_pf_status                                            *
    -->  RT_EXTAB                                                      *
    form set_pf_status using rt_extab type slis_t_extab.
      set pf-status 'ZNEWSTATUS'.
    endform.
    *&      Form  build_events
          text
    -->  p1        text
    <--  p2        text
    form build_events.
      data: ls_event type slis_alv_event.
      call function 'REUSE_ALV_EVENTS_GET'
       exporting
         i_list_type           = 0
       importing
         et_events             = gt_events[]
    EXCEPTIONS
      LIST_TYPE_WRONG       = 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.
      read table gt_events with key name =  slis_ev_end_of_page
                  into ls_event.
      if sy-subrc = 0.
        move 'END_OF_PAGE' to ls_event-form.
        append ls_event to gt_events.
      endif.
      read table gt_events with key name =  slis_ev_end_of_list
                  into ls_event.
      if sy-subrc = 0.
        move 'END_OF_LIST' to ls_event-form.
        append ls_event to gt_events.
      endif.
    endform.                    " build_events
    *&      Form  build_print_params
          text
    -->  p1        text
    <--  p2        text
    form build_print_params.
      gd_prntparams-reserve_lines = '3'.   "Lines reserved for footer
      gd_prntparams-no_coverpage = 'X'.
    endform.                    " build_print_params
          FORM END_OF_PAGE                                              *
    form end_of_page.
      data: listwidth type i,
      ld_pagepos(10) type c,
      ld_page(10)    type c.
      write: sy-uline(50).
      skip.  write:/40 'Page:', sy-pagno .
    endform.
          FORM END_OF_LIST                                              *
    form end_of_list.
      data: listwidth type i,
      ld_pagepos(10) type c,
      ld_page(10)    type c.
      skip.  write:/40 'Page:', sy-pagno .
    endform.
    *&      Form  build_sortcat
          text
    -->  p1        text
    <--  p2        text
    form build_sortcat.
    wa_sort-spos      = 1.
    wa_sort-fieldname = 'EBELN'.
    append wa_sort to it_sortcat.
    wa_sort-spos      = 2.
    wa_sort-fieldname = 'EBELP'.
    append wa_sort to it_sortcat.
    endform.                    " build_sortcat
    Rewards if helpfull
    regards
    vijay dwivedi

  • Any example for a MFC, WTL or Win32 without Measurement Studio?

    It seems that NI wants you buy their Measurement Studio which can easily cost you a fortune. I am looking around a simple example for MFC, WTL without touching the measurement studio. But if you do not have measurement studio, NI only gives you very old examples in ANSI C which is difficult to implement to MFC or WTL. Apparently they want to increase their revenue by forcing you to buy the Measurement Studio. But I will not buy their hardware in the future if this is their strategy.
    Anyone successfully implement the ANSI C example to MFC or WTL without measurement studio? Can you share an example?

    Junqi,
    Im a little confused with this request in general. What development environment are you using? Visual Studio? Also, what language are you coding in? We provide C, C#, VB.net, and legacy VB6 examples with our DAQmx driver that do not require measurement studio. They can be found in documents\National Instruments\NI-DAQ\Examples 
    Now forgive me if Im misinformed about this, but MFC and WTL are just libraries that have some of the windows API wrapped into them, correct? If so, I dont see how interfacing with them is any different than interfacing with any other library, or why this would cause issues with doing DAQ calls. If you need help with the MFC or WTL library, there are many good places to find help with on the internet. MSDN, codeproject.com, and many others come up as having examples of using MFC in various projects.   
    The MS examples dont install withough MS because they wouldnt be able to be used because they use libraries that are installed with measurement studio, so they would be nonfunctional and largely useless. 
    Regards,
    Kyle Mozdzyn
    Applications Engineering
    National Instruments
    Regards,
    Kyle M.
    Applications Engineering
    National Instruments

  • Are there any good code examples for displaying preview images in the storefront?

    I can gather other info using folio.xxx, but can not find any good examples to use for preview images.  Tried folio.getPreviewImage() with no success.  Oh, I should mention it is version 2.  Plenty of examples for version 1.
    Perhaps if I get a little more specific.
    I am calling up the folios via:
           adobeDPS.libraryService.folioMap.addedSignal.add(function(folios) {
                for (var i = 0; i < folios.length; i++) {
                    addFolio(folios[i]);
            }, this);
    This eventually works into a function where I am gathering and displaying folio data:
         var productId = folio.productId;
        var html  = "<div id='" + productId + "'>";
            html +=     "<a href='#'><img class='shadow' width='120' src='' border=0 /></a>";
            html +=     "<br /><span class='bold'>" + folio.title + "</span>";
            html += "</div>";
        this.$el = $(html);
    folio.title works fine to pull up the title, but I can no longer use folio.getPreviewURL in v2.  What code should I be using to set the src to the preview image?
    Thanks

    Have you looked at the default implementations of the library?
    In FolioItemView's render function, there is a function(follow the nested functions!):
    setTimeout(function(){ scope.loadPreviewImage() }, 100);
    It references this function (this doesn't copy well):
    loadPreviewImage: function() {
    if (this.el.parentElement) {
    var transaction = this.folio.getPreviewImage(135, 180, true);
    transaction.completedSignal.addOnce(this.getPreviewImageHandler, this);
    Going deeper, into the getPreviewImageHandler function is where you see the url value..
    if (transaction.state == adobeDPS.transactionManager.transactionStates.FINISHED && transaction.previewImageURL != null) {
                                  this.$el.find(".folio-thumb").attr("src", transaction.previewImageURL);
    Within the example is also code for supplying a preview when the Adobe API is not available:
    (Within the render function)
    var json = this.model.toJSON();
    $folioThumb.attr("src", json.libraryPreviewUrl);
    If you're making any changes to where the preview is displayed, you can just swap out the class ".folio-thumb" to whatever the class (or id) is of the element you're wanting to render the preview in.

Maybe you are looking for

  • Hierarchy displays on Web but not on BeX

    Hi All, We have upgraded our system from BW 3.5 to BW 7.0. We are at a suport pack 9 now. Patch Level 44. BeX Version 3.5. Post Upgrade when we run any query which contains Hierarchy objects and try filtering them, we get an error message, "Operation

  • How to uncheck a checkbox using Screen Variants?

    Hi Masters! Anybody knows how to uncheck a checkbox that is already checked by default? I'm trying to do this using screen variants. I uncheck the checkbox and save the value (I also tried filling other values there like 'a', space, etc. and it didn'

  • Help! iMessage mystery

    Can anyone help me figure out what is going on with iMessage?  I recently switched from an iPhone to an Android (don't worry guys, I still have my MBA, iPad, iPad Mini, 2 other iPhones, etc.).  The Android is a test right now, but I am stumped with i

  • Can't activate iphone

    Help! Can't activate iphone. When phone is connected via USB 2.0, get windows message that iphone is camera and to select program (eg microsoft word, sonic) to launch action. itunes 7.4 version doesn't recognize iphone either. Any help would be great

  • Asset  - Restating tax books for 2006

    Hello Asset Mavens! Do you know how to restate the tax books (they don't post to general ledger) for a prior year (2006) due to an acquisition.  This is for tax returns related to a company that was spun off: Assets acquired in Jan or Feb 2006 have a