Refresh Item in a IR

Hi all.
I would like to show date and time ( Refreshed 05/05/2010 13:55:21 ) in a IR region every user interaction.
Is that possible ?
I added in a IR region a display item with pl/sql return but it hasn´t been refreshed !
Thanks for any help.
Angelo
Apex 3.2.1

Angelo,
There is currently no "good" way to do this. With APEX 4, however, you will be able to attach JavaScript functions to both the before and after refresh events of interactive reports.
Regards,
Dan
Blog: http://DanielMcGhan.us/
Work: http://SkillBuilders.com/apex/

Similar Messages

  • My new iphone is running extremley slow, internet takes ages to load, apps take ages to install and has trouble connecting to app store. and the apps dont work properly like ebay wont open or refresh items, plz help

    my new iphone is running extremley slow, internet takes ages to load, apps take ages to install and has trouble connecting to app store. and the apps dont work properly like ebay wont open or refresh items, plz help
    my iphone4 is 10 times faster
    i have backed up on itunes and restored but still no luck
    even siri is lagging

    my new iphone is running extremley slow, internet takes ages to load, apps take ages to install and has trouble connecting to app store. and the apps dont work properly like ebay wont open or refresh items, plz help
    my iphone4 is 10 times faster
    i have backed up on itunes and restored but still no luck
    even siri is lagging

  • How to make use of Listener to auto refresh  items in SelectOneMenu

    Hi,
    I have a transaction jsp page that make use of the SelectOneMenu of which the Selectitems for example consists of all the item_code are added to the dropdownitems through the sessionBean1 ArrayList.
    The problem started when new item_code are being added to the SQL tables using other JSP that allow user to input new item code.
    JSF transaction page using SelectOneMenu could not effectively updated the options to include and reflect the new item subsequently added simply because the page has been rendered to the user .
    I believe using some sort of listener , whenever any action or event took place , JSP that are having the particular UI components being rendered could be auto refresh at the client side of JSP html page.
    Could anyone provide some hints?
    Thank

    Hi,
    Thank for the suggestion,
    In fact I am looking for two possiblity on how to overcome this sort of issues,
    Firstly , if the JSF page has not been rendered , you could always make use of the sessionbean1 to do the job , for example if you add a new item to the selectOneMenu dropitems, you could make use of this method to update the list of items in the dropitems , though it would always be the last items on the sorted list .
    Secondly , using some sort of autorefresh to push to the client to inform the user that new item have been added , advise them to manual refresh the page.
    I am in fact using the first method to add new item to the dropdownmenu for those JSP that involve page forwarding and redirect such as shopping basket / cart beans .
    My concern is when displaying the list of real-time shopping items available to the user , method 1 would not work at all , simply because JSF page was already rendered to the user browser, only beaming alerting message seems to be able to overcome such shortcoming when scenario demand realtime.
    Thank

  • Refresh items in iMovie event?

    I removed some duplicate items in my iMovie event via finder. Is there a way to refresh the items in iMovie without having to copy them somewhere else and re-import them?

    First close iMovie
    In your iMovie Events folder (in the Finder), you should have a folder with the same name as your Event name.
    Within this folder you should see your Event clips. You will want to keep these unless you have them backed up somewhere. But you can move all the subfolders to the trash. Move the cache, thumbnails, analysis, etc folders to the trash.
    Now restart iMovie. It should see your event and regenerate the thumbnails, cache, analysis, etc.

  • Skillbuilders Modal Refresh Item and Region separately on parent

    I have a page with two regions.
    One region has a LOV field and a button that calls a modal window to update the LOV values. On return I fire a DA based on the Modal autoclose event with a selection type of DOM Object and document object set to "document". That works.
    I have a second region and a button that calls a modal window to create a record for that region. I want the submit on that modal page to refresh the second region. This is not working. I tried to hang it off the first DA just to get it working. That did not work. That second region is a pl/sql region that calls a pl/sql procedure to build the region,  if that matters.
    harry

    Harry,
    A PL/SQL type region is not refresh-able like this through dynamic actions.
    One way to achieve something like this would be to recreate your PL/SQL region as an Application Process that is called On Demand (or even create an Ajax Callback in the page). You can then call this process via aja where it will return the results of your print statements. Then you would work with the return value to place it on the page.
    This thread shows example code that you could follow:
    Write Javascript from On Demand Process
    Greg

  • Refresh display image item without reload page

    hi all, is a way to refresh (requery) a display image item to change the image via botton and do not reload page ?
    thanks
    Edited by: Reza.Gh. on Sep 24, 2012 11:56 AM

    I create a sample app :
    https://apex.oracle.com/pls/apex/f?p=9310:1
    code of item  P1_CAPTCHA_IMG :
    SELECT captcha_img FROM captcha WHERE response = :P1_CAP_V;
    item P1_CAP_V  code (computations) :
    SELECT *
    FROM (
    SELECT response
    FROM captcha
    ORDER BY
    dbms_random.value
    WHERE rownum = 1 ;
    Refresh botton code :
    action 1 :
    SELECT * into :P1_CAP_V
    FROM (
    SELECT response
    FROM captcha
    ORDER BY
    dbms_random.value
    WHERE rownum = 1;
    action 2:
    refresh item P1_CAPTCHA_IMG

  • Change item Label based on Another item's value

    Hi guys,
    I need to set an item label (A) based on the value of another item (B). I did the following:
    I Created a dynamic action.
    When B changes:
    1- submit the value of B
    2- Refresh item A
    The label of the item A is : myitem &B.
    Any ideas ????
    Best Regards,
    Fateh

    Fateh wrote:
    Ok... Thanks a lot... but before closing the thread and for better understanding.
    I put this code on Execute when Page Loads:
    $("#P1_A").change(function(){
    if($v(this)=="Rent"){
    $('#mylabel > label > span').text('Is it for Sale also');
    }else{
    $('#mylabel > label > span').text('Is it for Rent also');
    }However, the label does not change. Any ideas why this is not working????
    Regards,
    Fateh
    $v(this)
    you are mixing jquery and apex API, it won't work
    and missing *});* at the end, and when adding to the page load you should wrap them in $(document).ready( code here.... });
    $(document).ready(function () {
         $("#P1_A").change(function () {
              if ($(this).val() == "Rent") {
                   $('#mylabel > label > span').text('Is it for Sale also');
              } else {
                   $('#mylabel > label > span').text('Is it for Rent also');
    });

  • Hide refresh from UWL tray menu

    How can I hide the "Refresh" link from the UWL inbox tray menu?  The refresh link that I'm referring to is along with other links like "manage substitution rules, personalize view, Display connection status".
    Thanks
    Praveen

    I found solution, I had to put "refresh" in the UWL iView property "List of UWL Actions to exclude".  This would remove refresh item from the tray menu.
    Thanks
    Praveen

  • Queue based publication items

    has anyone used these and what for?
    (sort of) managed to get these to work as a replacement for all of our fast refresh publication items, and get real time synchronisation without the MGP process running, but had to put in some serious work arounds to get it to do fast refreshes and getting it set up is complicated
    I would be interested in kowing what other people have done with them to see if there is anything that i have missed

    2 hour compose with the 400+ users was the situation when we went live in August 2006, and whilst not perfect, that was ok. We also never had any problem with mobile blocking users when it started the compose cycle. current situation is upto 12 hour compose cycle with 5 minutes of blocking all users when it starts - this is not acceptable
    Database is however overly generic, and in some cases uses inappropriate structures (example status table looks to be growing at the rate of a million records a month, with only a hundred or so of those records of any interest). We also started using streams for extranet services, and the two do not look to play nicely together.
    no more options for tuning (did everything when we went live), partitioning may help but difficult with the database structures, most of the data is specific to our users, most of the data that could be shared is within complete refresh items to bypass the MGP process already.
    We could (and may still do, as the implementation of the queue based stuff is going to be very complicated) stick with the MGP process and do tricks like create our own logging triggers to stop 'uninteresting' records being logged in the CVR$ tables and C$ALLL_SID_LOGGED_TABLES, and then delete unnecessary data from the CVR$ tables to speed up the process logs phase (sure it is not recommended but it works), use MyCompose to work around the poor execution plans put together by the default compose process, and DML call outs to impove the apply processing, but my fear is we will be back in the same boat in 18 months time.
    As 90%+ of our synchronisations are done unattended between about 7:30 pm and 10pm, a slower but more real time sync option fits in the business model fairly well, and to my mind why pre-prepare data 12 times a day (assuming 2 hour cycle) with all of the continual performance overhead, when they only download it once when noone else is working?
    The queue based stuff is a bit cumbersome and an odd mixture of java, PL/SQL and DDL scripts (plus a few cheats inserting data directly into the repository tables, and updating other things), and the development effort required should not be underestimated.
    anyone considering it needs to be clear about what they are trying to achieve (the examples are very limited to stuff you could do with complete refresh items easier), and needs a good understanding of the internals. Definitely not suitable if synchronisation time is a priority (eg: if using GPRS all of the time). I should be able to get the average sync time down to 3-4 minutes, but compared with the 20-30 seconds currently that is still a big jump

  • Force refresh, only triggers complete refresh PI

    Hello everyone,
    I have a question regarding the usage of the "Force Refresh" option when running mSync (Oracle Lite 10.3.0.1). We have a publication that consists of both complete and fast refresh publication items. Whenever we run a mSync with the "Force Refresh" option enabled, we observe in webtogo that only the complete refresh publication items will be refreshed. Based on the documentation I'm expecting that all publication items should be refreshed. Is this a correct assumption? If so, do I have to make some changes to specific settings to enable synchronization of all publication items, or did I ran into a bug ?
    Thanks in advance
    Patrick

    What do you see in the sync log when doing a force refresh?
    you should see all publication items downloaded with the correct number of records. the complete refresh items should show
    Complete refresh. Cause :: PubItem_mode=complete refresh
    the fast refresh should show CRR
    When you said a user did a rebuild and got the same behaviour, do you mean that the fast refresh publication items were
    a) there with all of thier data
    b) tables there, but no data
    c) not there at all
    if a, then force refresh should work
    if b, then probably an issue with data subsetting or instantiation
    if c, then check c$all_client_items and see if they appear in the list, and check the instantiated flag in data synchronisation>repository>publications>users. If not instantiated, you may not get all of the data
    if there are objects missing from c$all_client_items, try a cut, paste and save on a data subsetting value for the user as that should reset the user

  • Can we create purchase order through report programming?

    hi experts.....
    can we create purchase order through report programming?If yes plz give me the thread details?

    Hi,
    Use this code in a program by using a BAPI function module
    Anothe rway is using classical/ALV report using call transaction from a report for changing the PO
    loop at i_header.
        header-ref_1         = i_header-legacy.
        headerx-ref_1        = c_x.
        header-doc_type      = i_header-bsart.
        headerx-doc_type     = c_x.
        header-comp_code     = i_header-bukrs.
        headerx-comp_code    = c_x.
        header-purch_org     = i_header-ekorg.
        headerx-purch_org    = c_x.
        header-pur_group     = i_header-ekgrp.
        headerx-pur_group    = c_x.
        header-vendor        = i_header-lifnr.
        headerx-vendor       = c_x.
        concatenate i_header-bedat+4(4)
                    i_header-bedat+0(2)
                    i_header-bedat+2(2)
                    into header-doc_date.
        headerx-doc_date     = c_x.
        header-created_by    = i_header-ernam.
        headerx-created_by   = c_x.
        header-currency      = i_header-waers.
        headerx-currency     = c_x.
        concatenate i_header-kdatb+4(4)
                    i_header-kdatb+0(2)
                    i_header-kdatb+2(2)
                    into header-vper_start.
        headerx-vper_start   = c_x.
        loop at i_items where legacy = i_header-legacy.
          item-po_item            =  i_items-ebelp.
          itemx-po_item           =  i_items-ebelp.
          itemx-po_itemx          =  c_x.
          if i_header-bsart = 'NB'.
            item-material            =  i_items-ematn.
            itemx-material           =  c_x.
            schedule-quantity        =  i_items-menge * 1000.
            schedulex-quantity       =  c_x.
          else.
            item-short_text          = i_items-ematn.
            itemx-short_text         = c_x.
            item-matl_group          = '1000'.
            itemx-matl_group         = c_x.
            schedule-quantity        =  '1'.
            schedulex-quantity       =  c_x.
          endif.
          item-plant               =  i_items-werks.
          itemx-plant              =  c_x.
          schedule-po_item         = i_items-ebelp.
          schedule-sched_line      = '1'.
          schedulex-po_item        = i_items-ebelp.
          schedulex-sched_line     = '1'.
          schedulex-po_itemx       = c_x.
          schedulex-sched_linex    = c_x.
          concatenate  i_items-eildt+0(2)
                       i_items-eildt+2(2)
                       i_items-eildt+4(4)
                       into schedule-delivery_date.
          schedulex-delivery_date  =  c_x.
          item-price_unit          =  i_items-peinh * 100.
          itemx-price_unit         =  c_x.
          item-tax_code            =  i_items-mwskz.
          itemx-tax_code           =  c_x.
          item-shipping            =  i_items-evers.
          itemx-shipping           =  c_x.
          account-po_item          = i_items-ebelp.
          accountx-po_item         = i_items-ebelp.
          accountx-po_itemx        = c_x.
          if i_header-bsart = 'FO'.
            item-pckg_no  = sy-tabix.
            itemx-pckg_no = 'X'.
            limits-pckg_no        = sy-tabix.
            limits-limit          = i_items-overalllimit.
            limits-exp_value      = i_items-expectedoverall.
            posrvaccessvalues-pckg_no    = sy-tabix.
            posrvaccessvalues-line_no    = '0'.
            posrvaccessvalues-serno_line = '00'.
            posrvaccessvalues-percentage = '100.0'.
            posrvaccessvalues-serial_no  = '01'.
            account-serial_no     = '1'.
            accountx-serial_no    = '1'.
            accountx-serial_nox   = c_x.
            account-quantity  = '1'.
            accountx-quantity = c_x.
            call function 'CONVERSION_EXIT_ALPHA_INPUT'
              exporting
                input  = i_items-kostl
              importing
                output = account-costcenter.
            accountx-costcenter   = c_x.
            call function 'CONVERSION_EXIT_ALPHA_INPUT'
              exporting
                input  = i_items-sakto
              importing
                output = account-gl_account.
            accountx-gl_account   = c_x.
            item-acctasscat       = i_items-knttp.
            itemx-acctasscat      = c_x.
            item-item_cat         = i_items-epstp.
            itemx-item_cat        = c_x.
          endif.
          append:item,itemx,schedule,schedulex,account,accountx,limits,posrvaccessvalues.
          clear :item,itemx,schedule,schedulex,account,accountx,limits,posrvaccessvalues.
        endloop.
        call function 'BAPI_PO_CREATE1'
          exporting
            poheader                     = header
            poheaderx                    = headerx
    *   POADDRVENDOR                 =
    *   TESTRUN                      =
    *   MEMORY_UNCOMPLETE            =
    *   MEMORY_COMPLETE              =
    *   POEXPIMPHEADER               =
    *   POEXPIMPHEADERX              =
    *   VERSIONS                     =
    *   NO_MESSAGING                 =
    *   NO_MESSAGE_REQ               =
    *   NO_AUTHORITY                 =
    *   NO_PRICE_FROM_PO             =
            importing
            exppurchaseorder             = ponumber
    *   EXPHEADER                    =
    *   EXPPOEXPIMPHEADER            =
            tables
            return                       = return
            poitem                       = item
            poitemx                      = itemx
    *   POADDRDELIVERY               =
            poschedule                   = schedule
            poschedulex                  = schedulex
            poaccount                    = account
    *   POACCOUNTPROFITSEGMENT       =
            poaccountx                   = accountx
    *   POCONDHEADER                 =
    *   POCONDHEADERX                =
    *   POCOND                       =
    *   POCONDX                      =
            polimits                     = limits
    *   POCONTRACTLIMITS             =
    *   POSERVICES                   =
       posrvaccessvalues            = posrvaccessvalues.
    *   POSERVICESTEXT               =
    *   EXTENSIONIN                  =
    *   EXTENSIONOUT                 =
    *   POEXPIMPITEM                 =
    *   POEXPIMPITEMX                =
    *   POTEXTHEADER                 =
    *   POTEXTITEM                   =
    *   ALLVERSIONS                  =
    *   POPARTNER                    =
        if ponumber eq space.
          loop at return where type = 'E'.
            clear buffer.
            move-corresponding return to e_return.
            concatenate i_header-legacy e_return into buffer.
            transfer buffer to p2_file.
          endloop.
          move-corresponding i_header to i_eheader.
          transfer i_eheader to p3_file.
          loop at i_items where legacy = i_header-legacy.
            move-corresponding i_items to i_eitems.
            transfer i_eitems to p4_file.
          endloop.
        else.
          commit work and wait.
        endif.
        clear:ponumber,header,headerx,item,itemx,account,accountx,limits,return,schedule,schedulex,posrvaccessvalues.
        refresh:item,itemx,account,accountx,limits,return,schedule,schedulex,posrvaccessvalues.
      endloop.
      close dataset p2_file.
      close dataset p3_file.
      close dataset p4_file.
    Regards
    Krishna

  • BAPI_PO_Create1

    Hi all,
    i have a problem while running this BAPI i get an exception FAILURE...Can any 1 help me to avoid tht.
    *& Report  Y1MM_PODRG_TEST1                                            *
    REPORT  Y1MM_PODRG_TEST1                        .
    TABLES: MARA,
    LFA1,
    EINA,
    EINE,
    EBAN,
    ZDRGSAH, ZDRGSAP,
    T100.
    *Internal Table to get the input Data
    DATA: BEGIN OF I_INPUT OCCURS 0,
    MATNR LIKE EKPO-MATNR,
    ASQTY LIKE EKPO-MENGE,
    EBELN LIKE EKPO-EBELN,
    POSNR LIKE ZDRGSAP-POSNR,
    INVNO LIKE ZDRGSAP-INVNO,
    INVDT LIKE ZDRGSAH-INVDT,
    NETPR LIKE ZDRGSAP-NETPR,
    CNTNO LIKE ZDRGSAP-CNTNO,
    SHCNM LIKE ZDRGSAH-SHCNM,
    WERKS LIKE EKPO-WERKS,
    LGORT LIKE EKPO-LGORT,
    MATKL LIKE EKPO-MATKL,
    END OF I_INPUT.
    DATA: BEGIN OF I_ERROR OCCURS 0,
    MATNR LIKE MARA-MATNR,
    REMARK(255) TYPE C,
    END OF I_ERROR.
    DATA: I_MARA TYPE MARA OCCURS 0 WITH HEADER LINE,
    I_EINA LIKE EINA OCCURS 0 WITH HEADER LINE,
    I_EINE LIKE EINE OCCURS 0 WITH HEADER LINE.
    *Data declaration.
    DATA: V_FILE TYPE STRING, " Variable for uploading file
    V_ITEM(5) TYPE C, " Line item number
    V_ITNO(2) TYPE C,
    P_WKURS LIKE ZDRGKURS-WKURS,
    V_MATNR(20) TYPE C,
    V_MENGE(20) TYPE C,
    V_BANFN(20) TYPE C,
    V_BNFPO(20) TYPE C,
    V_BEDNR(20) TYPE C,
    P_LIFNR LIKE LFA1-LIFNR,
    V_FLAG,
    P_LIFNRTXT(10),
    P_WKURSTXT(9),
    P_BSARTXT(4).
    DATA: BEGIN OF I_INPUTXT OCCURS 0,
    MATNR(18) ,
    ASQTY(13) ,
    EBELN(10) ,
    POSNR(6) ,
    INVNO(10) ,
    INVDT(8) ,
    NETPR(11) ,
    CNTNO(11) ,
    SHCNM(10) ,
    WERKS(4) ,
    LGORT(4) ,
    MATKL(9) ,
    END OF I_INPUTXT.
    Constants
    CONSTANTS : C_PD01 LIKE EINE-WERKS VALUE 'PD01',
    C_X VALUE 'X'.
    DATA : V_POSNR LIKE I_INPUTXT-POSNR.
    *Structures to hold PO header data
    DATA : HEADER LIKE BAPIMEPOHEADER ,
    HEADERX LIKE BAPIMEPOHEADERX .
    DATA : CHEADER LIKE BAPIMEPOCONDHEADER OCCURS 0 WITH HEADER LINE,
    CHEADERX LIKE BAPIMEPOCONDHEADERX OCCURS 0 WITH HEADER LINE.
    *data : cheaderx like bapimepocondheaderx.
    *data : begin of cheaderx occurs 0,
    cond_type like bapimepocondheaderx-cond_type,
    end of cheaderx.
    *Internal Tables to hold PO ITEM DATA
    DATA : ITEM LIKE BAPIMEPOITEM OCCURS 0 WITH HEADER LINE,
    ITEMX LIKE BAPIMEPOITEMX OCCURS 0 WITH HEADER LINE,
    *Internal table to hold messages from BAPI call
    RETURN LIKE BAPIRET2 OCCURS 0 WITH HEADER LINE.
    DATA : W_HEADER(40) VALUE 'PO Header'.
    DATA : WS_LANGU LIKE SY-LANGU.
    *text-001 = 'PO Header' - define as text element
    DATA : V_COMPANY LIKE HEADER-COMP_CODE VALUE 'SBA' ,
    V_DOCTYP LIKE HEADER-DOC_TYPE VALUE 'ZSEA' ,
    V_CDATE LIKE HEADER-CREAT_DATE,
    V_VENDOR LIKE HEADER-VENDOR ,
    V_PUR_ORG LIKE HEADER-PURCH_ORG VALUE 'SBAP' ,
    V_PUR_GRP LIKE HEADER-PUR_GROUP VALUE 'PG1' .
    *Selection Screen Declarations
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-010.
    PARAMETERS: P_INVNO LIKE ZDRGSAH-INVNO OBLIGATORY,
    P_BSART LIKE EKKO-BSART.
    SELECTION-SCREEN END OF BLOCK B1.
    *selection-screen begin of block b2 with frame title text-002.
    *parameters : item_num like item-po_item default '00010',
    material like mara-matnr default '0011442062' ,
    plant like item-plant default 'PD01' ,
    quantity like item-quantity default 100.
    *selection-screen end of block b2.
    START-OF-SELECTION.
    *DATA POPULATION
      WS_LANGU = SY-LANGU. "Language variable
    To Upload the data into Internal table.
      PERFORM F_UPLOAD_DATA.
    To Validate the input data.
      PERFORM F_CHECK_DATA.
    if i_error[] is initial.
    To process the data file
    perform f_process_session.
    elseif not i_error[] is initial.
    To display the error message
    perform f_display_error.
      PERFORM BAPI_CALL_DATA.
    endif.
    END-OF-SELECTION.
    *Output the messages returned from BAPI call
      LOOP AT RETURN.
        WRITE / RETURN-MESSAGE.
      ENDLOOP.
    *& Form f_upload_data
    FORM F_UPLOAD_DATA .
      refresh i_input.
      SELECT MATWA AS MATNR ASQTY EBELN POSNR B~INVNO INVDT NETPR CNTNO
      SHCNM INTO TABLE I_INPUT
      FROM ZDRGSAH AS A JOIN ZDRGSAP AS B ON
      A~INVNO = B~INVNO
      WHERE B~INVNO EQ P_INVNO.
      LOOP AT I_INPUT.
        SELECT SINGLE * FROM EBAN
        WHERE BANFN EQ I_INPUT-EBELN
        AND BNFPO EQ I_INPUT-POSNR.
        IF SY-SUBRC EQ 0.
          MOVE EBAN-WERKS TO I_INPUT-WERKS.
          MOVE EBAN-LGORT TO I_INPUT-LGORT.
          MOVE EBAN-MATKL TO I_INPUT-MATKL.
          MODIFY I_INPUT.
          CLEAR I_INPUT.
        ENDIF.
      ENDLOOP.
    ENDFORM. " f_upload_data
    *& Form f_check_data
    FORM F_CHECK_DATA .
      IF NOT I_INPUT[] IS INITIAL.
        SELECT * FROM MARA
        INTO TABLE I_MARA
        FOR ALL ENTRIES IN I_INPUT
        WHERE MATNR EQ I_INPUT-MATNR.
      ENDIF.
      IF I_MARA[] IS INITIAL.
        MESSAGE E000(ZCNC) WITH TEXT-001.
      ENDIF.
      READ TABLE I_INPUT INDEX 1.
      IF SY-SUBRC EQ 0.
        SELECT SINGLE LIFNR INTO P_LIFNR FROM ZDRGSUP
        WHERE SHCNM = I_INPUT-SHCNM.
        IF SY-SUBRC <> 0.
          MESSAGE E000(ZCNC) WITH TEXT-002.
        ENDIF.
      ENDIF.
      SELECT SINGLE WKURS INTO P_WKURS FROM ZDRGKURS
      WHERE INVNO = P_INVNO.
      IF SY-SUBRC NE 0.
        MESSAGE E000(ZCNC) WITH TEXT-S11.
      ENDIF.
    call function 'CONVERSION_EXIT_ALPHA_OUTPUT'
    exporting
    input = p_lifnr
    importing
    output = p_lifnr.
      P_LIFNRTXT = P_LIFNR.
      P_WKURSTXT = P_WKURS.
      P_BSARTXT = P_BSART.
      LOOP AT I_INPUT.
        MOVE-CORRESPONDING I_INPUT TO I_INPUTXT.
        APPEND I_INPUTXT.
      ENDLOOP.
    ENDFORM. "f_check_data
    *& Form bapi_call_data
    text
    FORM BAPI_CALL_DATA.
    *POPULATE HEADER DATA FOR PO
      V_CDATE = SY-DATUM.
      HEADER-COMP_CODE = V_COMPANY .
      HEADER-DOC_TYPE = V_DOCTYP .
      HEADER-CREAT_DATE = V_CDATE .
      HEADER-VENDOR = P_LIFNR .
      HEADER-LANGU = WS_LANGU .
      HEADER-QUOTATION = P_INVNO.
      HEADER-EXCH_RATE = P_WKURS.
      HEADER-EX_RATE_FX = 'X'.
      HEADER-PURCH_ORG = V_PUR_ORG .
      HEADER-PUR_GROUP = V_PUR_GRP .
      HEADER-DOC_DATE = SY-DATUM.
    *POPULATE HEADER FLAG.
      HEADERX-COMP_CODE = C_X.
      HEADERX-DOC_TYPE = C_X.
      HEADERX-CREAT_DATE = C_X.
      HEADERX-VENDOR = C_X.
      HEADERX-LANGU = C_X.
      HEADERX-QUOTATION = C_X.
      HEADERX-EXCH_RATE = C_X.
      HEADERX-EX_RATE_FX = C_X.
      HEADERX-PURCH_ORG = C_X.
      HEADERX-PUR_GROUP = C_X.
      HEADERX-DOC_DATE = C_X.
    **POPULATE HEADER DATA.CONDITIONS
    CHEADER-COND_TYPE = 'ZCA1'.
    APPEND CHEADER.
    CHEADER-COND_TYPE = 'ZFA1'.
    APPEND CHEADER.
    CHEADER-COND_TYPE = 'ZINC'.
    APPEND CHEADER.
    CHEADER-COND_TYPE = 'ZIV1'.
    APPEND CHEADER.
    CHEADER-COND_TYPE = 'ZOT1'.
    APPEND CHEADER.
    **POPULATE HEADER CONDITION FLAG.
    CHEADERX-COND_TYPE = C_X.
    APPEND CHEADERX.
    cheaderx-cond_type = c_x.
    append cheaderx.
    cheaderx-cond_type = c_x.
    append cheaderx.
    cheaderx-cond_type = c_x.
    append cheaderx.
    cheaderx-cond_type = c_x.
    append cheaderx.
    *POPULATE ITEM DATA.
    perform bdc_field using v_bednr i_input-cntno.
    item-price_unit = '100'.
    itemx-net_price = c_x.
    append itemx.
    clear itemx.
    endloop.
      LOOP AT I_INPUTXT.
        CONCATENATE I_INPUTXT-POSNR(4) '0' INTO V_POSNR.
        ITEM-PO_ITEM = V_POSNR.
        ITEM-PLANT = 'PD01'.
    item-stge_loc = i_inputxt-lgort.
        ITEM-MATERIAL = I_INPUTXT-MATNR.
        ITEM-MATL_GROUP = I_INPUTXT-MATKL.
        ITEM-QUANTITY = I_INPUTXT-ASQTY.
        ITEM-PREQ_NO = I_INPUTXT-EBELN.
        ITEM-PREQ_ITEM = V_POSNR.
        ITEM-TRACKINGNO = I_INPUTXT-CNTNO.
    item-preq_item = i_input-posnr.
    item-net_price = item-price_unit * item-quantity.
        APPEND ITEM.
    *POPULATE ITEM FLAG TABLE
      CONCATENATE I_INPUTXT-POSNR(4) '0' INTO V_POSNR.
      ITEMX-PO_ITEM = V_POSNR.
      ITEMX-PO_ITEMX = C_X.
      ITEMX-MATERIAL = C_X.
      ITEMX-PLANT = C_X .
    itemx-stge_loc = c_x .
      ITEMX-QUANTITY = C_X .
      ITEMX-STGE_LOC = C_X .
      ITEMX-TAX_CODE = C_X .
      ITEMX-ITEM_CAT = C_X .
      ITEMX-PREQ_NO = C_X.
      ITEMX-PREQ_ITEM = C_X.
      ITEMX-ACCTASSCAT = C_X .
      APPEND ITEMX.
      ENDLOOP.
    break-point.
    *BAPI CALL
      CALL FUNCTION 'BAPI_PO_CREATE1'
      EXPORTING
      POHEADER = HEADER
      POHEADERX = HEADERX
    POADDRVENDOR =
    TESTRUN =
    IMPORTING
    EXPPURCHASEORDER =
    EXPHEADER =
    EXPPOEXPIMPHEADER =
      TABLES
    pocondheader = cheader
    pocondheaderx = cheaderx
      RETURN = RETURN
      POITEM = ITEM
      POITEMX = ITEMX.
    *Confirm the document creation by calling database COMMIT
      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
        EXPORTING
          WAIT = 'X'.
    IMPORTING
    RETURN =
    refresh item.
    refresh itemx.
    endloop.
    ENDFORM. "bapi_call_data
    *if sy-subrc = 0.
    loop at return.
    write / return-message.
    endloop.
    *endif

    Hi Eshwar,
    the following description is given.
    Runtime errors         RAISE_EXCEPTION  
           Occurred on     24.12.2006 at 08:52:21
                                                                                    Exception condition "FAILURE" raised.   
    Regards,
    Santosh Kotra.

  • Trouble executing "some" auto generated php remote services...?

    Hi,
    I was using the flash builder 4 premium trial with the 4.0 sdk, recently I bought the CS5 web premium suite. It includes flash builder 4.0.1 standard with 4.1 sdk.
    1. create a new flex project (as in the welcome tutorial)
    2. create a sample PHP service using my db infos (let it install Zend_AMF for me)
    3. place a datagrid in the desing mode,
    4. drop the the "getAll()" method on it
    5. tweek some columns,
    6. it works, I see the service call and answer with service capture (an external AMF service monitor).
    the 2 problems that appear now (which were not existing in the 4.0 trial version I had)
    1) add a new item
    protected var newItem:dbItem;
    protected function addBtn_clickHandler(event:MouseEvent):void
    newItem = new dbItem();
    newItem.attribute = 'someValue';
    this.addDbItem(newItem:dbItem);
    protected function addDbItem(item:dbItem:void
    createDbItemResult.token = dbItemService.createDbItem(item);
    <s:Button label="new item" id="addBtn" click="addBtn_clickHandler(event)"/>
    When I click the button, absolutely NOTHING happens, no error, no service call, nothing at all.
    2) refresh the datagrid's dataprovider
    I followed the tutorial on how to bind an ArrayCollection to the dataGrid instead of binding it to "service.lastresult"
    populate the ArrayCollection with the service result handler with event.result as ArrayCollection... everything works like before. whe the datagrid is created, it calls the "dataGrid_creationCompleteHandler".
    protected function dataGrid_creationCompleteHandler(event:FlexEvent):void
    this.getAllDbItem();
    protected function refreshBtn_clickHandler(event:MouseEvent):void
    this.getAllDbItem();
    protected function getAllDbItemResult_resultHandler(event:ResultEvent):void
    DbItems = event.result as ArrayCollection;
    <s:Button label="refresh" id="refreshBtn" click="refreshBtn_clickHandler(event)"/>
    this works!, the refresh button also works, BUT... it only refreshes item which have not bee edited within the app... if I change some item value with a form, (still using skills from the tutorial) :
    - the data in the datagrid ARE UPDATED.
    - the service.update(item) method DOES NOT EXECUTE (like the create above)
    - if I update the DB manualy, ONLY the NON UPDATED rows refresh...
    Any idea?
    Thank you! I'm stuck here for hours and hours now :-(
    the full MXML code
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
       xmlns:s="library://ns.adobe.com/flex/spark"
       xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600" xmlns:moniteurservice="services.moniteurservice.*" xmlns:valueObjects="valueObjects.*">
    <fx:Script>
    <![CDATA[
    import mx.collections.ArrayCollection;
    import mx.controls.Alert;
    import mx.events.FlexEvent;
    import mx.rpc.events.ResultEvent;
    [Bindable]
    protected var moniteurs:ArrayCollection = new ArrayCollection();
    protected function dataGrid_creationCompleteHandler(event:FlexEvent):void
    getAllMoniteurResult.token = moniteurService.getAllMoniteur();
    protected function button_clickHandler(event:MouseEvent):void
    moniteur.statut = statutTextInput.text;
    moniteur.nom = nomTextInput.text;
    moniteur.prenom = prenomTextInput.text;
    moniteur.tel = telTextInput.text;
    moniteur.mobile = mobileTextInput.text;
    moniteur.email = emailTextInput.text;
    moniteur.adresse = adresseTextInput.text;
    moniteur.npa = npaTextInput.text;
    moniteur.lieu = lieuTextInput.text;
    moniteur.pays = paysTextInput.text;
    this.updateMoniteur(moniteur);
    protected function updateMoniteur(item:Moniteur):void
    updateMoniteurResult.token = moniteurService.updateMoniteur(item);
    protected function button1_clickHandler(event:MouseEvent):void
    getAllMoniteurResult.token = moniteurService.getAllMoniteur();
    protected function getAllMoniteurResult_resultHandler(event:ResultEvent):void
    moniteurs = event.result as ArrayCollection;
    ]]>
    </fx:Script>
    <fx:Declarations>
    <s:CallResponder id="getAllMoniteurResult" result="getAllMoniteurResult_resultHandler(event)"/>
    <moniteurservice:MoniteurService id="moniteurService" fault="Alert.show(event.fault.faultString + '\n' + event.fault.faultDetail)" showBusyCursor="true"/>
    <valueObjects:Moniteur id="moniteur"/>
    <s:CallResponder id="updateMoniteurResult"/>
    <!-- Place non-visual elements (e.g., services, value objects) here -->
    </fx:Declarations>
    <fx:Binding source="dataGrid.selectedItem as Moniteur" destination="moniteur"/>
    <mx:DataGrid x="25" y="24" id="dataGrid" creationComplete="dataGrid_creationCompleteHandler(event)"
    dataProvider="{moniteurs}">
    <mx:columns>
    <mx:DataGridColumn headerText="id" dataField="id"/>
    <mx:DataGridColumn headerText="statut" dataField="statut"/>
    <mx:DataGridColumn headerText="nom" dataField="nom"/>
    <mx:DataGridColumn headerText="prenom" dataField="prenom"/>
    <mx:DataGridColumn headerText="tel" dataField="tel"/>
    <mx:DataGridColumn headerText="mobile" dataField="mobile"/>
    <mx:DataGridColumn headerText="email" dataField="email"/>
    <mx:DataGridColumn headerText="adresse" dataField="adresse"/>
    <mx:DataGridColumn headerText="npa" dataField="npa"/>
    <mx:DataGridColumn headerText="lieu" dataField="lieu"/>
    <mx:DataGridColumn headerText="pays" dataField="pays"/>
    </mx:columns>
    </mx:DataGrid>
    <mx:Form defaultButton="{button}" x="25" y="174">
    <mx:FormItem label="Statut">
    <s:TextInput id="statutTextInput" text="{moniteur.statut}"/>
    </mx:FormItem>
    <mx:FormItem label="Nom">
    <s:TextInput id="nomTextInput" text="{moniteur.nom}"/>
    </mx:FormItem>
    <mx:FormItem label="Prenom">
    <s:TextInput id="prenomTextInput" text="{moniteur.prenom}"/>
    </mx:FormItem>
    <mx:FormItem label="Tel">
    <s:TextInput id="telTextInput" text="{moniteur.tel}"/>
    </mx:FormItem>
    <mx:FormItem label="Mobile">
    <s:TextInput id="mobileTextInput" text="{moniteur.mobile}"/>
    </mx:FormItem>
    <mx:FormItem label="Email">
    <s:TextInput id="emailTextInput" text="{moniteur.email}"/>
    </mx:FormItem>
    <mx:FormItem label="Adresse">
    <s:TextInput id="adresseTextInput" text="{moniteur.adresse}"/>
    </mx:FormItem>
    <mx:FormItem label="Npa">
    <s:TextInput id="npaTextInput" text="{moniteur.npa}"/>
    </mx:FormItem>
    <mx:FormItem label="Lieu">
    <s:TextInput id="lieuTextInput" text="{moniteur.lieu}"/>
    </mx:FormItem>
    <mx:FormItem label="Pays">
    <s:TextInput id="paysTextInput" text="{moniteur.pays}"/>
    </mx:FormItem>
    <s:Button id="button" label="Submit" click="button_clickHandler(event)"/>
    </mx:Form>
    <s:Button x="322" y="200" label="Button" click="button1_clickHandler(event)"/>
    </s:Application>
    the full PHP service code:
    <?php
    *  README for sample service
    *  This generated sample service contains functions that illustrate typical service operations.
    *  Use these functions as a starting point for creating your own service implementation. Modify the
    *  function signatures, references to the database, and implementation according to your needs.
    *  Delete the functions that you do not use.
    *  Save your changes and return to Flash Builder. In Flash Builder Data/Services View, refresh
    *  the service. Then drag service operations onto user interface components in Design View. For
    *  example, drag the getAllItems() operation onto a DataGrid.
    *  This code is for prototyping only.
    *  Authenticate the user prior to allowing them to call these methods. You can find more
    *  information at http://www.adobe.com/go/flex_security
    class MoniteurService {
    var $username = "root";
    var $password = "mikedev";
    var $server = "localhost";
    var $port = "8889";
    var $databasename = "test_db";
    var $tablename = "moniteur";
    var $connection;
    * The constructor initializes the connection to database. Everytime a request is
    * received by Zend AMF, an instance of the service class is created and then the
    * requested method is invoked.
    public function __construct() {
       $this->connection = mysqli_connect(
       $this->server, 
       $this->username, 
       $this->password,
       $this->databasename,
       $this->port
    $this->throwExceptionOnError($this->connection);
    * Returns all the rows from the table.
    * Add authroization or any logical checks for secure access to your data
    * @return array
    public function getAllMoniteur() {
    $stmt = mysqli_prepare($this->connection, "SELECT * FROM $this->tablename");
    $this->throwExceptionOnError();
    mysqli_stmt_execute($stmt);
    $this->throwExceptionOnError();
    $rows = array();
    mysqli_stmt_bind_result($stmt, $row->id, $row->statut, $row->nom, $row->prenom, $row->tel, $row->mobile, $row->email, $row->adresse, $row->npa, $row->lieu, $row->pays);
        while (mysqli_stmt_fetch($stmt)) {
          $rows[] = $row;
          $row = new stdClass();
          mysqli_stmt_bind_result($stmt, $row->id, $row->statut, $row->nom, $row->prenom, $row->tel, $row->mobile, $row->email, $row->adresse, $row->npa, $row->lieu, $row->pays);
    mysqli_stmt_free_result($stmt);
        mysqli_close($this->connection);
        return $rows;
    * Returns the item corresponding to the value specified for the primary key.
    * Add authorization or any logical checks for secure access to your data
    * @return stdClass
    public function getMoniteurByID($itemID) {
    $stmt = mysqli_prepare($this->connection, "SELECT * FROM $this->tablename where id=?");
    $this->throwExceptionOnError();
    mysqli_stmt_bind_param($stmt, 'i', $itemID);
    $this->throwExceptionOnError();
    mysqli_stmt_execute($stmt);
    $this->throwExceptionOnError();
    mysqli_stmt_bind_result($stmt, $row->id, $row->statut, $row->nom, $row->prenom, $row->tel, $row->mobile, $row->email, $row->adresse, $row->npa, $row->lieu, $row->pays);
    if(mysqli_stmt_fetch($stmt)) {
          return $row;
    } else {
          return null;
    * Returns the item corresponding to the value specified for the primary key.
    * Add authorization or any logical checks for secure access to your data
    * @return stdClass
    public function createMoniteur($item) {
    $stmt = mysqli_prepare($this->connection, "INSERT INTO $this->tablename (id, statut, nom, prenom, tel, mobile, email, adresse, npa, lieu, pays) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
    $this->throwExceptionOnError();
    mysqli_stmt_bind_param($stmt, 'issssssssss', $item->id, $item->statut, $item->nom, $item->prenom, $item->tel, $item->mobile, $item->email, $item->adresse, $item->npa, $item->lieu, $item->pays);
    $this->throwExceptionOnError();
    mysqli_stmt_execute($stmt);
    $this->throwExceptionOnError();
    $autoid = $item->id;
    mysqli_stmt_free_result($stmt);
    mysqli_close($this->connection);
    return $autoid;
    * Updates the passed item in the table.
    * Add authorization or any logical checks for secure access to your data
    * @param stdClass $item
    * @return void
    public function updateMoniteur($item) {
    $stmt = mysqli_prepare($this->connection, "UPDATE $this->tablename SET statut=?, nom=?, prenom=?, tel=?, mobile=?, email=?, adresse=?, npa=?, lieu=?, pays=? WHERE id=?");
    $this->throwExceptionOnError();
    mysqli_stmt_bind_param($stmt, 'ssssssssssi', $item->statut, $item->nom, $item->prenom, $item->tel, $item->mobile, $item->email, $item->adresse, $item->npa, $item->lieu, $item->pays, $item->id);
    $this->throwExceptionOnError();
    mysqli_stmt_execute($stmt);
    $this->throwExceptionOnError();
    mysqli_stmt_free_result($stmt);
    mysqli_close($this->connection);
    * Deletes the item corresponding to the passed primary key value from
    * the table.
    * Add authorization or any logical checks for secure access to your data
    * @return void
    public function deleteMoniteur($itemID) {
    $stmt = mysqli_prepare($this->connection, "DELETE FROM $this->tablename WHERE id = ?");
    $this->throwExceptionOnError();
    mysqli_stmt_bind_param($stmt, 'i', $itemID);
    mysqli_stmt_execute($stmt);
    $this->throwExceptionOnError();
    mysqli_stmt_free_result($stmt);
    mysqli_close($this->connection);
    * Returns the number of rows in the table.
    * Add authorization or any logical checks for secure access to your data
    public function count() {
    $stmt = mysqli_prepare($this->connection, "SELECT COUNT(*) AS COUNT FROM $this->tablename");
    $this->throwExceptionOnError();
    mysqli_stmt_execute($stmt);
    $this->throwExceptionOnError();
    mysqli_stmt_bind_result($stmt, $rec_count);
    $this->throwExceptionOnError();
    mysqli_stmt_fetch($stmt);
    $this->throwExceptionOnError();
    mysqli_stmt_free_result($stmt);
    mysqli_close($this->connection);
    return $rec_count;
    * Returns $numItems rows starting from the $startIndex row from the
    * table.
    * Add authorization or any logical checks for secure access to your data
    * @return array
    public function getMoniteur_paged($startIndex, $numItems) {
    $stmt = mysqli_prepare($this->connection, "SELECT * FROM $this->tablename LIMIT ?, ?");
    $this->throwExceptionOnError();
    mysqli_stmt_bind_param($stmt, 'ii', $startIndex, $numItems);
    mysqli_stmt_execute($stmt);
    $this->throwExceptionOnError();
    $rows = array();
    mysqli_stmt_bind_result($stmt, $row->id, $row->statut, $row->nom, $row->prenom, $row->tel, $row->mobile, $row->email, $row->adresse, $row->npa, $row->lieu, $row->pays);
        while (mysqli_stmt_fetch($stmt)) {
          $rows[] = $row;
          $row = new stdClass();
          mysqli_stmt_bind_result($stmt, $row->id, $row->statut, $row->nom, $row->prenom, $row->tel, $row->mobile, $row->email, $row->adresse, $row->npa, $row->lieu, $row->pays);
    mysqli_stmt_free_result($stmt);
    mysqli_close($this->connection);
    return $rows;
    * Utility function to throw an exception if an error occurs
    * while running a mysql command.
    private function throwExceptionOnError($link = null) {
    if($link == null) {
    $link = $this->connection;
    if(mysqli_error($link)) {
    $msg = mysqli_errno($link) . ": " . mysqli_error($link);
    throw new Exception('MySQL Error - '. $msg);
    ?>

    >
    >  the service.update(item) method DOES NOT EXECUTE (like the create above)
    >
    I think you are not using the "commit" on the service. By default the Data services are "managed".
    Data management features allow you to synchronize adding, updating, and deleting of records in a database. Changes you make in the client application are not written to the server until a "commit" method is called. You can call a revert method to roll back changes made in the client application.
    So wherever you update or create add "commit" to the service after adding/updating. for eg.
    protected function addDbItem(item:dbItem:void
         createDbItemResult.token = dbItemService.createDbItem(item);
         dbItemService.commit();
    I think the following article might be of interest to you:
    http://help.adobe.com/en_US/Flex/4.0/FlexTutorials/WSbde04e3d3e6474c4292a0331216558354b-80 00.html#WSbde04e3d3e6474c4-10020e8112165e18e29-8000

  • Creating the Sales Order using the bapi BAPI_SALESORDER_CREATEFROMDAT2

    Hi,
    My problem is , i have created one module pool program for accelerating the Sales Order creation.
    I am using the bapi BAPI_SALESORDER_CREATEFROMDAT2 for sales order creation. After executing the program
    bapi is given an errot that, incomplete sales order document is saved.
    Can any body tell me plz what are the necessary fields i need to take in the header and item level , so that the complete
    document will be saved through BAPI.
    <removed_by_moderator>
    Thanks
    Edited by: Julius Bussche on Jan 11, 2010 12:09 PM

    TABLES: VBAK,                             "Sales Document: Header Data
            VBAP.                             "Sales Document: Item Data
    *************************************WORK AREA DECELERATION************************
    DATA: BEGIN OF WA_HEADER,
            LI    TYPE I,                      "LINE TYPE
            AUART TYPE VBAK-AUART,             "Sales Document Type
            VKORG TYPE VBAK-VKORG,             "Sales Organization
            VTWEG TYPE VBAK-VTWEG,             "Distribution Channel
            SPART TYPE VBAK-SPART,             "Division
            KUNNR TYPE BAPIPARNR-PARTN_NUMB,   "Customer number
          END OF WA_HEADER.
    DATA: BEGIN OF WA_ITEM,
            LI     TYPE I,
            MATNR  TYPE VBAP-MATNR,            "MATERIAL NUMBER
            ZMENG  TYPE VBAP-ZMENG,           "QUANTITY
          END OF WA_ITEM.
    ***********************************INTERNAL TABLE DECELERATION***************************************
    DATA: IT_HEADER      LIKE TABLE OF WA_HEADER WITH HEADER LINE.                   "IT FOR HEADER
    DATA: IT_ITEM        LIKE TABLE OF WA_ITEM WITH HEADER LINE.                     "IT FOR ITEM
    DATA: IT             LIKE VBAK OCCURS 0 WITH HEADER LINE.
    ***************************SALES ORDER INTERNAL TABLE DECELERATION********************************
    DATA:
          HEADER  TYPE TABLE OF BAPISDHEAD WITH HEADER LINE,        "SALES HEADER DATA
          ITEMS   TYPE TABLE OF BAPIITEMIN WITH HEADER LINE,         "SALES ITEM DATA
          PARTNERS TYPE TABLE OF BAPIPARTNR WITH HEADER LINE.      "SALLES PARTNERS
    ***********************************DYNAMIC FIEL PATH GETTING DECELERATION************************
    DATA : HL_FIELD_NAME TYPE DYNPREAD-FIELDNAME VALUE 'G_P_SPATH',              "SCREEN FIELD NAME
           HL_FILE_NAME  TYPE IBIPPARMS-PATH VALUE 'G_P_SPATH',                  "Local file for upload/download
           IL_FIELD_NAME TYPE DYNPREAD-FIELDNAME VALUE 'G_P_EPATH',              "SCREEN FIELD NAME
           IL_FILE_NAME  TYPE IBIPPARMS-PATH VALUE 'G_P_EPATH',                  "Local file for upload/download
           FL_FIELD_NAME TYPE DYNPREAD-FIELDNAME VALUE 'G_P_EPATH',              "SCREEN FIELD NAME
           FL_FILE_NAME  TYPE IBIPPARMS-PATH VALUE 'G_P_EPATH'.                  "Local file for upload/download
    DATA : CTR TYPE I .
    DATA : CTR2 TYPE STRING.
    DATA : CTR1 TYPE STRING.
    Sales document number
    DATA : L_VBELN LIKE BAPIVBELN-VBELN.
    SELECTION-SCREEN : BEGIN OF BLOCK B1 WITH FRAME TITLE T1.
    SELECTION-SCREEN : SKIP.
    PARAMETER        : P_HPATH TYPE STRING.
    PARAMETER        : P_IPATH TYPE STRING.
    SELECTION-SCREEN : SKIP.
    SELECTION-SCREEN : END OF BLOCK B1.
    SELECTION-SCREEN : BEGIN OF BLOCK B2 WITH FRAME TITLE T2.
    SELECTION-SCREEN : SKIP.
    SELECTION-SCREEN : BEGIN OF LINE.
    SELECTION-SCREEN : PUSHBUTTON 10(14) UPLOAD USER-COMMAND CLICK1.
    SELECTION-SCREEN : END OF LINE.
    SELECTION-SCREEN   END OF BLOCK B2.
    ******************************************INITIALIZATION.***************************************************
    INITIALIZATION.
      T1       = 'Putchase Order Source File Path'.
      T2       = 'Push Button'.
      UPLOAD   = 'Upload'.
    *******************************************AT SELECTION SCREE EVENT********************************************
    AT SELECTION-SCREEN.
      CASE SY-UCOMM.
        WHEN 'CLICK1'.
          IF P_HPATH IS INITIAL AND P_IPATH IS INITIAL.      "CHECKING BTHE THE TEXT BOX
            MESSAGE I009.
          ELSE.
            PERFORM SELECT.                                  "CALLING THE SELECT SUBROUTINE
          ENDIF.
        WHEN OTHERS.
          MESSAGE 'PRESS FORM BUTTON' TYPE 'I'.      "WHEN EXECUTE BUTTON IS PRESSED
      ENDCASE.
    ***********************************GETTING HEADER FIEL PATH*******************************************
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_HPATH.
      CALL FUNCTION 'F4_FILENAME'
        EXPORTING
          PROGRAM_NAME  = SYST-CPROG
          DYNPRO_NUMBER = SYST-DYNNR
          FIELD_NAME    = HL_FIELD_NAME
        IMPORTING
          FILE_NAME     = HL_FILE_NAME.
      P_HPATH = HL_FILE_NAME.
    ***********************************GETTING ITEM FIEL PATH*******************************************
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_IPATH.
      CALL FUNCTION 'F4_FILENAME'
        EXPORTING
          PROGRAM_NAME  = SYST-CPROG
          DYNPRO_NUMBER = SYST-DYNNR
          FIELD_NAME    = IL_FIELD_NAME
        IMPORTING
          FILE_NAME     = IL_FILE_NAME.
      P_IPATH = IL_FILE_NAME.
    START-OF-SELECTION.
    *&      Form  SELECT
          text
    -->  p1        text
    <--  p2        text
    FORM SELECT .
      CALL FUNCTION 'GUI_UPLOAD'             " function resposible to get the local flat
          EXPORTING                          " and upload it in a internal table
            FILENAME            = P_HPATH
            FILETYPE            = 'ASC'
            HAS_FIELD_SEPARATOR = '#'
          TABLES
            DATA_TAB            = IT_HEADER.
      CALL FUNCTION 'GUI_UPLOAD'             " function resposible to get the local flat
          EXPORTING                          " and upload it in a internal table
            FILENAME            = P_IPATH
            FILETYPE            = 'ASC'
            HAS_FIELD_SEPARATOR = '#'
          TABLES
            DATA_TAB            = IT_ITEM.
      LOOP AT IT_HEADER.
        Initialize Header values
        HEADER-DOC_TYPE     =  IT_HEADER-AUART.
        HEADER-SALES_ORG    =  IT_HEADER-VKORG.
        HEADER-DISTR_CHAN   =  IT_HEADER-VTWEG.
        HEADER-DIVISION     =  IT_HEADER-SPART.
        APPEND HEADER.
        PARTNERS-PARTN_ROLE = 'WE'.
        PARTNERS-PARTN_NUMB = IT_HEADER-KUNNR.
        APPEND PARTNERS.
        CTR = 10.
        LOOP AT IT_ITEM WHERE LI = IT_HEADER-LI.
          CTR2 = CTR.
          CONCATENATE '0000' CTR2 INTO CTR1.
    ***Initialize Item values
         ITEMS-ITM_NUMBER   = IT_ITEM-ITEM.
          ITEMS-ITM_NUMBER   = CTR1.
          ITEMS-MATERIAL     = IT_ITEM-MATNR.
          ITEMS-REQ_QTY   = IT_ITEM-ZMENG.
          APPEND ITEMS.
          CTR = CTR + 10.
        ENDLOOP.
        CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT1'
          EXPORTING
            ORDER_HEADER_IN = HEADER                      "SALES HEADER DATA
          IMPORTING
            SALESDOCUMENT   = L_VBELN                        "RETRIEVED SALES DOCUMENT NUMBER
          TABLES
            ORDER_ITEMS_IN  = ITEMS                       "SALES ITEM LEVEL DATA
            ORDER_PARTNERS  = PARTNERS.                    "SAKES PARTNERS
        APPEND L_VBELN TO IT.
        COMMIT WORK AND WAIT.
        CLEAR : HEADER , ITEMS[] ,PARTNERS,CTR,CTR1,CTR2.
        REFRESH : ITEMS.
      ENDLOOP.
      IF IT[] IS NOT INITIAL.
        LOOP AT IT.
          WRITE: / 'SALES ORDER', IT-VBELN , 'CREATED'.
        ENDLOOP.
        LEAVE TO LIST-PROCESSING.
        SET PF-STATUS SPACE.
      ELSE.
        MESSAGE I044.
      ENDIF .
    ENDFORM.                    " SELECT

  • Calling Function in a loop for CM

    Hi,
    I have the program to create Credit Memo with user selected records. It is working if the user selects any one customer and it will create CM for that customer. But now user wants to select different customers and based on each different vkorg vtweg spart kunnr it has to create different Credit Memo's. How should I put the function in the loop so that it creates different CM's based on each customer.
    Please help me.
    Thanks,
    Neelu.
    AT USER-COMMAND.
      CASE sy-ucomm.
        WHEN 'CMEMO'.
          DESCRIBE TABLE gt_zprice LINES lv_cnt.
          DO lv_cnt TIMES.
            lv_index = sy-index + 1.
            READ LINE lv_index FIELD VALUE chbox.
            IF chbox = 'X'.
              READ TABLE gt_zprice INTO gs_zprice1 INDEX sy-index.
              IF sy-subrc EQ 0.
                gs_zprice1-index = sy-index.
                APPEND gs_zprice1 TO gt2_zprice.
                CLEAR gs_zprice1.
              ENDIF.
            ENDIF.
            CLEAR chbox.
          ENDDO.
          gt4_zprice[] = gt2_zprice[].
    *      SORT gt2_zprice BY vkorg vtweg spart kunnr.
    *      DELETE ADJACENT DUPLICATES FROM gt2_zprice
    *                      COMPARING vkorg vtweg spart kunnr.
    *      DESCRIBE TABLE gt2_zprice LINES lv_lines.
    *      IF lv_lines = 1.
              LOOP AT gt4_zprice INTO gs_zprice1.
                AT NEW kunnr.
                  MOVE 'Y' TO lv_flg.
                ENDAT.
                IF lv_flg EQ 'Y'.
                  PERFORM headerdata.
                  PERFORM texts.
                  CLEAR lv_flg.
                ENDIF.
                PERFORM itemdata.
                APPEND gs_zprice1 TO gt3_zprice.
                CLEAR gs_zprice1.
              ENDLOOP.
              lv_itemno = 10.
              PERFORM call_function.
              PERFORM update_pricetable.
              PERFORM errorcheckandcommit.
              PERFORM displaydata.
              REFRESH gt2_zprice.
              CLEAR chbox.
              CLEAR lv_lines.
              REFRESH partner.
              REFRESH item.
              REFRESH itemx.
              REFRESH lt_schedules_in.
              REFRESH lt_schedules_inx.
              REFRESH conditions1.
              REFRESH order_text.
            ELSE.
              REFRESH gt2_zprice.
              CLEAR chbox.
              EXIT.
            ENDIF.
      ENDCASE.

    call the credimemo create routines at end of kunnr inside the loop.
    LOOP AT gt4_zprice INTO gs_zprice1.
                AT NEW kunnr.
                  MOVE 'Y' TO lv_flg.
                ENDAT.
                IF lv_flg EQ 'Y'.
                  PERFORM headerdata.
                  PERFORM texts.
                  CLEAR lv_flg.
                ENDIF.
                PERFORM itemdata.
                APPEND gs_zprice1 TO gt3_zprice.
                CLEAR gs_zprice1.
    <b>at end of kunnr.
          PERFORM call_function.
              PERFORM update_pricetable.
              PERFORM errorcheckandcommit.
              PERFORM displaydata.
              REFRESH gt2_zprice.
              CLEAR chbox.
              CLEAR lv_lines.
              REFRESH partner.
              REFRESH item.
              REFRESH itemx.
              REFRESH lt_schedules_in.
              REFRESH lt_schedules_inx.
              REFRESH conditions1.
              REFRESH order_text.
    endat.</b>
              ENDLOOP.
              lv_itemno = 10.
           ELSE.
              REFRESH gt2_zprice.
              CLEAR chbox.
              EXIT.
            ENDIF.
      ENDCASE.

Maybe you are looking for

  • How do i copy music from my itunes account to a usb drive

    how do i copy music from my itunes account to a usb drive

  • Help needed in changing Access query to Oracle query

    hello folks, I have already posted this question and got some help previously but i have additional query being added to the previous one so thought of seeking some help.here it goes Am having an access report which comes from a query. the current qu

  • Opening a URL from a button within a Web Template

    Hi All, I have a requirement to provide report specific help from within a standard web template. Assuming that I had a list of help URLs for each report and an intermediary way to redirect to those URL based upon a unique id such as the reports tech

  • How to include portlet in .menu

    HI, I want to include portlet in .menu means i need to include that portlet to the jsp which is refered by .menu. Can someone please guide me? Thanks, Sanjeev Edited by: Sanjeev Kumar on Mar 6, 2012 3:02 AM

  • Wow.. INSANITY..  Sony DVD player crashes!

    Well.. I am a little discouraged here.. I got my project all perfect, and it plays great on my computer DVD player as well as in the simulator. I play it on my Sony commerical DVD player, and if I stop the DVD during any one of the menus, upon playin