QTY in BDC --Urgent...

Hi experts,
I am stuck up in a very typical problem. requirement is to create  Z screen and call the sapstandrad screen from there to post the data.
I have created a proxy screen for MB01 having 7 fields like Sloc, PO no, Qty, Unit, PLant, Movement Type. From this zscreen, i am calling MB01 transction through BDC.
When i call in my program (Screen) and enter the values of all 7 fields, this data is passed to MB01. ALl the values are being passed execpt for the Quantity Field.
When i give the MSEG-ERFMG as constant, it is passed on to MB01, but when i pass it though a variable 'ITAB-ERFMG', its not passing. And MB01 is picking the default open qty from PO.
When i try to debug it, i can see that
(wa_bdcdata-fnam     = fnam.
wa_bdcdata-fval     = fval.
append wa_bdcdata to bdcdata.)
in FVAL data is there, but when i check wa_bdcdata-fval , its blank. This is not the case with other 5 fields, there i can see the value in wa_bdcdata-fval .
Pls help, its urgent...
Thanks,

Hi,
This is also not working. I dont understand when with the same code 5 fields are updated, why just this Qty field is not.
This is the form statement that i wrote.
form bdc_field using fnam fval.
  clear wa_bdcdata.
  wa_bdcdata-fnam     = fnam.
  wa_bdcdata-fval     = fval.
  write fval to wa_bdcdata-fval.
  append wa_bdcdata to bdcdata.
ENDFORM.                    " WRITE_MESSAGE
Performs statement is :
perform bdc_field1       using 'MSEG-ERFMG(01)'
                              ITAB-ERFMG.     "qty
perform bdc_field       using 'MSEG-ERFME(01)'
                              ITAB-ERFME.     "unit
perform bdc_field       using 'MSEG-LGORT(01)'
                              ITAB-LGORT.    "sloc
itab is the internale table getting data from proxy screen.
Unit and Storage Location is working fine, qty is not passsing.
Pls help..

Similar Messages

  • Facing problem during uploadation of Routing data using CA01-BDC - URGENT

    Dear All,
    When I am trying to upload Routing data using CA01 in the Table Control scenario, then I am facing problem as my last 2 records are not getting uploaded from my Test file.
    For example, I am having 47 records in my Test File and after setting ‘Default size’ parameters (to avoid screen resolution problem)
    I have 15 table control line items data per page. The Page down logic ('=P+') is working fine, but my below BDC code failed to take
    the remainder last 2 records from the Test File.
    Analysis: When I am running my “Call Transaction” bdc in foreground, then the 1st page down occurs after 15th record, 2nd page down occurs after 29th record( as in Table Control 1st page’s 15th record is coming on the Top of 2nd page). 3rd page down occurs after 43rd record
    (as 2nd page’s 29th record is coming on the top of 3rd page). In the 4th Table Control Page 43rd record of previous page is coming on top, and then it’s taking 44th & 45th records from the Test File and then it is triggering SAVE (=BU). Thus, our last 2 records
    (i.e. 46th, 47th record) are not getting uploaded in the routing screen from our Test File.
    If anybody has encountered this scenario previously, please help me URGENTLY in fixing the bugs here. It’s VERY, VERY URGENT…
    FYI. For others 45 successful records already uploaded, all the screen fields values are coming properly in the routing screen, and here there is no issue.
    Thanks very much…
    Thanks & Regards
    Sudipta – Project Lead
    Volvo Client Location
    I am pasting my BDC source code below:
    REPORT ZRT1_UPLOAD_CA01_F
                           NO STANDARD PAGE HEADING
                           LINE-SIZE 255.
                            I N C L U D E S                              *
    Include for Data Declarations
    INCLUDE zrout_top.
    Include for Forms
    INCLUDE zrout_form.
    INCLUDE zrout_include_f_ca01.
    *AT SELECTION-SCREEN ON VALUE-REQUEST FOR <field>
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
    Attaching F4 help with filename
      PERFORM F1001_GET_F4.
               S T A R T   -   O F  -  S E L E C T I O N                 *
    START-OF-SELECTION.
    Perform to read the input file
      PERFORM f_read_file.
    Perform to fill the BDC data
      PERFORM f_fill_bdctab.
                   E N D   -   O F  -  S E L E C T I O N                 *
    END-OF-SELECTION.
      FREE: i_bdcdata,
            i_messtab,
            i_record.
    x----
    *&  Include           ZROUT_TOP                                        *
                      D A T A B A S E    T A B L E S                     *
    TABLES: t100.          "Messages
                    D A T A    D E C L A R A T I O N S                   *
    T A B L E    T Y P E S *****************************
    For input data
    TYPES: BEGIN OF ty_record,
            matnr(18),  "Material Number
            werks(4),   "Plant
            verwe(3),   "Usage
            statu(3),   "Status
            arbpl(8),   "Work Center
            steus(4),   "Control Key
            ltxa1(40),  "Description of Operation
            bmsch(13),  "Base Quantity
            meinh(3),   "Unit of Measure
            vgw01(11),  "Machine
            vge01(3),   "Unit of measure of activity
          END OF ty_record.
    I N T E R N A L    T A B L E S ***********************
    Internal Table for input file name
    DATA: i_file_tab  TYPE STANDARD TABLE OF sdokpath   INITIAL SIZE 0.
    Internal Table for BDC Data
    DATA: i_bdcdata   TYPE STANDARD TABLE OF bdcdata    INITIAL SIZE 0.
    Internal Table for BDC Messages
    DATA: i_messtab   TYPE STANDARD TABLE OF bdcmsgcoll INITIAL SIZE 0.
    Internal Table for Input file
    DATA: i_record TYPE STANDARD TABLE OF ty_record INITIAL SIZE 0.
    W O R K      A R E A S *************************
    Work Area for input file name
    DATA: wa_file_tab LIKE sdokpath.
    Work Area for BDC Data
    DATA: wa_bdcdata LIKE bdcdata.
    Work Area for BDC Messages
    DATA: wa_messtab LIKE bdcmsgcoll.
    Work Area for Input file
    DATA: wa_record TYPE ty_record.
    V A R I A B L E S ****************************
    DATA: v_filename TYPE string,
          v_fnam(40) TYPE c.
    DATA: wa_opt TYPE ctu_params.
    C O N S T A N T S ***************************
    CONSTANTS: c_werks TYPE rc27m-werks VALUE 'tp',
               c_steus TYPE plpod-steus VALUE 'PP01'.
    *Selection Screen.
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    PARAMETERS:
              Input file name
                P_FILE TYPE rlgrap-filename OBLIGATORY. " DEFAULT 'C:\'.
    SELECTION-SCREEN END OF BLOCK B1.
    x----
    *&  Include           ZROUT_FORM                                       *
    *&      Form  f_fill_bdctab
          Form to fill the BDC Data
    FORM f_fill_bdctab.
      TABLES mapl.          "Assignment of Task Lists to Materials
      DATA: l_cnt_item(3)  TYPE n VALUE 1.    "Line item counter
      DATA: first(3)  TYPE n VALUE 16.    "Line item counter
      DATA: next(3)  TYPE n .    "Line item counter
      DATA: lin(3) TYPE n .    "Line item counter
      DATA: l_v_bmsch(13),   "Base qty
            l_v_meinh(3),    "Unit of Measure
            l_v_vgw01(11),   "Machine
            l_v_vgw02(11),   "Labour
            l_v_vge01(3).    "Unit of measure of activity
      DATA l_v_nextline TYPE sy-tabix.
      DATA wa_temp TYPE ty_record.
        Initialize Counter
          l_cnt_item = 1.
      SORT i_record BY matnr.
      LOOP AT i_record INTO wa_record.
    AT NEW matnr.
        REFRESH: i_bdcdata,
                 i_messtab.
        SET PARAMETER ID 'PLN' FIELD space.
        SET PARAMETER ID 'PAL' FIELD space.
        PERFORM f_bdc_dynpro      USING 'SAPLCPDI' '1010'.
        PERFORM f_bdc_field       USING 'BDC_OKCODE'
                                        '/00'.
      Material Number
        PERFORM f_bdc_field       USING 'RC27M-MATNR'
                                        wa_record-matnr.
       Plant
        PERFORM f_bdc_field       USING 'RC27M-WERKS'
                                        c_werks.
        PERFORM f_bdc_field       USING 'RC271-PLNNR'
      Check if routing already exits for the material
        SELECT * FROM mapl
                      INTO mapl
                                WHERE matnr EQ wa_record-matnr
                                  AND werks EQ c_werks
                                  AND plnty EQ 'N'.
          IF sy-subrc EQ 0.
            PERFORM f_bdc_dynpro      USING 'SAPLCPDI' '1200'.
            PERFORM f_bdc_field       USING 'BDC_OKCODE'
                                            '=ANLG  '.
          ENDIF.
        ENDSELECT.
        perform f_bdc_dynpro      USING 'SAPLCPDA' '1200'.
        perform f_bdc_field       USING 'BDC_OKCODE'
                                  '=VOUE'.
    Group Counter
        perform f_bdc_field       USING 'PLKOD-PLNAL'
      Usage
        PERFORM f_bdc_field       USING 'PLKOD-VERWE'
                                        '1'.
      Status
        PERFORM f_bdc_field       USING 'PLKOD-STATU'
                                        '4'.
    ENDAT.
        PERFORM f_bdc_dynpro      USING 'SAPLCPDI' '1400'.
      Check if page is full
        IF l_cnt_item EQ '16'.
        Page down
          PERFORM f_bdc_field       USING 'BDC_OKCODE'
                                               '=P+'.
          l_cnt_item = 1.
    ELSE.
    PERFORM f_bdc_field       USING 'BDC_OKCODE'
                                  '/00'.
    ENDIF.
       CLEAR v_fnam.
      Populate item level details
    Work Center
        CONCATENATE 'PLPOD-ARBPL(' l_cnt_item ')' INTO v_fnam.
        PERFORM f_bdc_field       USING v_fnam
                                        wa_record-arbpl.
      Control Key
        CONCATENATE 'PLPOD-STEUS(' l_cnt_item ')' INTO v_fnam.
        PERFORM f_bdc_field       USING v_fnam
                                        c_steus.
      Description of Operation
        CONCATENATE 'PLPOD-LTXA1(' l_cnt_item ')' INTO v_fnam.
        PERFORM f_bdc_field       USING v_fnam
                                        wa_record-ltxa1.
      Base Quantity
        CONCATENATE 'PLPOD-BMSCH(' l_cnt_item ')' INTO v_fnam.
        PERFORM f_bdc_field       USING v_fnam
                                        wa_record-bmsch.
      Unit of Measure
        CONCATENATE 'PLPOD-MEINH(' l_cnt_item ')' INTO v_fnam.
        PERFORM f_bdc_field       USING v_fnam
                                        wa_record-meinh.
      Machine
        CONCATENATE 'PLPOD-VGW01(' l_cnt_item ')' INTO v_fnam.
        PERFORM f_bdc_field       USING v_fnam
                                        wa_record-vgw01.
      Labour
       CONCATENATE 'PLPOD-VGW02(' l_cnt_item ')' INTO v_fnam.
       PERFORM f_bdc_field       USING v_fnam
                                       wa_record-vgw02.
      Unit of measure of activity
        CONCATENATE 'PLPOD-VGE01(' l_cnt_item ')' INTO v_fnam.
        PERFORM f_bdc_field       USING v_fnam
                                        wa_record-vge01.
          l_cnt_item = l_cnt_item + 1.
       CLEAR wa_record.
    AT END OF matnr.
         PERFORM f_bdc_field       USING 'BDC_OKCODE'
                                  '/00'.
          PERFORM f_bdc_field         USING 'BDC_OKCODE'
                                  '=BU'.
         wa_opt-DISMODE = 'A'.
         wa_opt-DEFSIZE = 'X'.
         wa_opt-UPDMODE = 'S'.
        PERFORM f_bdc_transaction USING 'CA01'.
       Initialize Counter
         l_cnt_item = 1.
    ENDAT.
      ENDLOOP.
    ENDFORM.                    " f_fill_bdctab
    x----
    *&  Include           ZROUT_INCLUDE_F_CA01                             *
    *&      Form  f_read_file
          Form to read the file from presentation server
    FORM f_read_file .
    To get the file name
      DATA l_v_file TYPE string.
    l_v_file = P_FILE.
    CALL FUNCTION 'GUI_UPLOAD'
          EXPORTING
            filename                = l_v_file
            filetype                = 'ASC'
            has_field_separator     = 'X'
          TABLES
            data_tab                = i_record
          EXCEPTIONS
            file_open_error         = 1
            file_read_error         = 2
            no_batch                = 3
            gui_refuse_filetransfer = 4
            invalid_type            = 5
            no_authority            = 6
            unknown_error           = 7
            bad_data_format         = 8
            header_not_allowed      = 9
            separator_not_allowed   = 10
            header_too_long         = 11
            unknown_dp_error        = 12
            access_denied           = 13
            dp_out_of_memory        = 14
            disk_full               = 15
            dp_timeout              = 16
            OTHERS                  = 17.
        IF sy-subrc <> 0.
          MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                  WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDIF.
    ENDIF.
    ENDFORM.                    " f_read_file
    *&      Form  f_bdc_dynpro
          Form to populate BDC Tab for new screen
         -->fp_program   Screen program name
         -->fp_dynpro    Screen Number
           Start new screen                                              *
    FORM f_bdc_dynpro USING fp_program fp_dynpro.
      CLEAR wa_bdcdata.
      wa_bdcdata-program  = fp_program.
      wa_bdcdata-dynpro   = fp_dynpro.
      wa_bdcdata-dynbegin = 'X'.
      APPEND wa_bdcdata TO i_bdcdata.
    ENDFORM.                    "f_bdc_dynpro
    *&      Form  f_bdc_field
           Insert field                                                  *
    FORM f_bdc_field USING fp_fnam fp_fval.
      IF NOT fp_fval IS INITIAL.
        CLEAR wa_bdcdata.
        wa_bdcdata-fnam = fp_fnam.
        wa_bdcdata-fval = fp_fval.
        APPEND wa_bdcdata TO i_bdcdata.
      ENDIF.
    ENDFORM.                    "f_bdc_field
    *&      Form  f_bdc_transaction
          Call transaction and error handling
         -->fp_tcode   Transaction code
    FORM f_bdc_transaction  USING fp_tcode.
      DATA: l_mstring(480),
            l_color         TYPE i,
            l_mode          TYPE c.
      REFRESH i_messtab.
    CALL TRANSACTION fp_tcode USING i_bdcdata
                       OPTIONS FROM wa_opt
                       MESSAGES INTO i_messtab.
    Messages during upload
      LOOP AT i_messtab INTO wa_messtab.
        CASE wa_messtab-msgtyp.
          WHEN 'S'.
            l_color = 5.
          WHEN 'E'.
            l_color = 6.
          WHEN 'W'.
            l_color = 3.
        ENDCASE.
        FORMAT COLOR = l_color.
        SELECT SINGLE * FROM t100 WHERE sprsl = wa_messtab-msgspra
                                  AND   arbgb = wa_messtab-msgid
                                  AND   msgnr = wa_messtab-msgnr.
        IF sy-subrc = 0.
          l_mstring = t100-text.
          IF l_mstring CS '&1'.
            REPLACE '&1' WITH wa_messtab-msgv1 INTO l_mstring.
            REPLACE '&2' WITH wa_messtab-msgv2 INTO l_mstring.
            REPLACE '&3' WITH wa_messtab-msgv3 INTO l_mstring.
            REPLACE '&4' WITH wa_messtab-msgv4 INTO l_mstring.
          ELSE.
            REPLACE '&' WITH wa_messtab-msgv1 INTO l_mstring.
            REPLACE '&' WITH wa_messtab-msgv2 INTO l_mstring.
            REPLACE '&' WITH wa_messtab-msgv3 INTO l_mstring.
            REPLACE '&' WITH wa_messtab-msgv4 INTO l_mstring.
          ENDIF.
          CONDENSE l_mstring.
          WRITE: / wa_messtab-msgtyp, l_mstring(250).
        ELSE.
          WRITE: / wa_messtab.
        ENDIF.
        FORMAT COLOR OFF.
      ENDLOOP.
      SKIP.
    ENDFORM.                    " f_bdc_transaction
    FORM F1001_GET_F4.
      CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
           EXPORTING
                PROGRAM_NAME  = SY-REPID
                DYNPRO_NUMBER = SY-DYNNR
                FIELD_NAME    = P_FILE
           CHANGING
                FILE_NAME     = P_FILE
           EXCEPTIONS
                MASK_TOO_LONG = 1
                OTHERS        = 2.
      IF SY-SUBRC <> 0.
      File is not selected
       MESSAGE I000 WITH TEXT-M01.
      ENDIF.
    ENDFORM.                    " F1001_GET_F4

    Sudipta,
    Would request you to post this to ABAP-Forum for Immediate response.
    I had this problem, but the ABAP guy did something to correct this...it was more of screen resoultion difference between the recorded system and uploading system. Please try to use the same system which was used to record and try.
    Regards,
    Prasobh

  • Use of CTU_PARAMS in bdc Urgent

    Hi, Experts,
    As I know from source that we can use CTU_PARAMS for bdc table controll having line items more than one screen.
    I am using this structure for mode and update. How can i use it for multiple lines handle.
    I have too much idea for bdc and created several. but for more data than one screen this structure can help me.
    If any one know, please share it.
    It is urgent now for me .
    Regards
    Rajiv singh.

    Hi Rajiv,
    Inorder to avoid this screen resolution problem we use CTU-PARAMS Structure.
    It contains:
    DISMODE : Display mode
    RACOMMIT: Do not end transaction at COMMIT WORK
    UPDMODE: Update mode
    DEFSIZE : Use default window size
    CATTMODE: CATT mode
    NOBINPT : No batch input mode
    NOBIEND : No batch input mode after the end of BDC data.
    Kindly check this and get back to me incase of any queries.
    Dont forget to reward points if found useful.
    Thanks,
    Satyesh

  • Unable to incorporate multiple data in BDC * URGENT*

    Hi EveryOne  .
      See the code. This code can do BDC for a single value of store and bonus buy no., in transaction  WPMA
    The current requirement is for a given store all bonus buy values should get populated and then executed each time store wise.
    Eg
        Store                            bonus buy values
        1001                               1
        1001                               2
         1001                              4
         1002                              A
         1002                             L
         1003                             6
         1003                             7
         1003                             H.
    See the code below, and tell me the necessary changes required!!
    report zwpma1
           no standard page heading line-size 255.
    type-pools slis.
    data: wt_fcat type slis_fieldcat_alv.
    data: it_fcat type slis_t_fieldcat_alv.
    data: cnt type sy-tabix.
    *include bdcrecx1.
    types: begin of ty_final,
           store(10) type c,
           docnum type docnum,
           bbynr type bbynr,
           end of ty_final.
    types: begin of ty_final1,
           store(10),
           bbynr type bbynr,
           end of ty_final1.
    data: wa_bonusbuy type zbonusbuy,
          it_bonusbuy type  standard table of zbonusbuy  with header line,
          it_bonusbuy1 type  standard table of ty_final1  with header line,
          it_t001w type  standard table of t001w  with header line,
          it_edidc type  standard table of edidc  with header line,
          it_edid4 type  standard table of edid4  with header line,
          it_final type  standard table of ty_final  with header line,
    *Work areas:
            wa_edidc type edidc,
            wa_edid4 type edid4,
            wa_final type ty_final.
    data :   it_bdcmsgcoll like bdcmsgcoll occurs 0 with header line.
    data: bdcdata like table of bdcdata with header line.
    data: lv_mode(1) value 'N'.
    data : mtext(100) type c,
           mvar1      like balm-msgv1,
           w_msg(200) type c.
    data : l_startt type sy-uzeit,   " Time before Recording
           l_endt type sy-uzeit,     " time after recording
           l_cdate type sy-datum.    " Current date
    start-of-selection.
      call function 'SAPGUI_PROGRESS_INDICATOR'
        exporting
          percentage = 100
          text       = 'Extracting Data.......  '.
      select werks  from t001w  into corresponding fields of table  it_t001w.
      delete adjacent duplicates from it_t001w  comparing werks.
      if not it_t001w[] is initial.
        select store bbynr mmid from  zbonusbuy  into corresponding fields of table it_bonusbuy for all
        entries in it_t001w where store = it_t001w-werks.
        if sy-subrc = 0.
          sort it_bonusbuy by store.
        endif.
      endif.
      refresh it_t001w.
      loop at it_bonusbuy.
        move-corresponding it_bonusbuy to it_bonusbuy1.
        append it_bonusbuy1.
        clear: it_bonusbuy, it_bonusbuy1.
      endloop.
      l_cdate = sy-datum.
      clear l_startt .
      l_startt = sy-uzeit.
      loop at it_bonusbuy.
    *break retaildev.
    *perform open_group.
        perform bdc_dynpro      using 'RWDPOSAN' '1000'.
        perform bdc_field       using 'BDC_CURSOR'
                                      'SO_BBUY-LOW'.
        perform bdc_field       using 'BDC_OKCODE'
                                      '=ONLI'.
        perform bdc_field       using 'PA_VKORG'
                                      'HB00'.
        perform bdc_field       using 'PA_VTWEG'
                                      'H2'.
        perform bdc_field       using 'SO_FISEL-LOW'
                                 '1001'.
                                it_bonusbuy-store.
       LOOP AT   it_bonusbuy1 WHERE store = it_bonusbuy-store.
          if sy-subrc = 0.
            perform bdc_field       using 'PA_BBUY'
                                          'X'.
            perform bdc_field       using 'SO_BBUY-LOW'
                                 'TEST_00035'.
                                         it_bonusbuy1-bbynr.
                                          it_bonusbuy-bbynr.
          endif.
          clear it_bonusbuy1.
       ENDLOOP.
    *Refresh: it_bonusbuy1.
        clear bdcdata.
        call transaction 'WPMA' using bdcdata
             mode lv_mode
          UPDATE 'S'
             messages into  it_bdcmsgcoll.
        refresh bdcdata.
        clear it_bonusbuy.
      endloop.
      l_endt = sy-uzeit.
      break retaildev.
      select docnum
             direct
             credat
             cretim
             mestyp
             idoctp
             from edidc into corresponding fields of table it_edidc
             where
             credat = l_cdate and
             ( cretim  ge l_startt and cretim le l_endt )  and
             mestyp = 'WPDBBY'  and
             idoctp = 'WPDBBY01'.  "  "    l_startt and l_endt  and
      break retaildev.
      if sy-subrc = 0.
        select docnum
               counter
               segnum
               segnam
               sdata
               from edid4 into corresponding fields of table it_edid4 for all entries in it_edidc
               where
               docnum = it_edidc-docnum.
      endif.
    *Loop at it_final into wa_final.
      loop at it_edid4 into wa_edid4 where segnam = 'E1WPBB01'.
        wa_final-store = wa_edid4-sdata(10).
        wa_final-docnum = wa_edid4-docnum.
        wa_final-bbynr = wa_edid4-sdata+10(12).
        append wa_final to it_final.
      endloop.
      delete adjacent duplicates from it_final comparing docnum store bbynr.
      sort it_final by store.
      clear: wa_final,wa_edidc, wa_edid4.
      refresh : it_edid4, it_edidc.
    *ALV OutPut
      write :'Following are the Idocs posted successfully Storewise' .
      loop at it_final.
        write :  it_final-store , it_final-docnum , it_final-bbynr   .
      endloop.
    *Break retaildev.
      perform top_of_page.
      perform alv_layout-settings.
      perform zalv_fieldcatpopn using it_fcat.
      perform z_reuse_alv_grid_display.

    Have you tried serialization and sendingas an object using something like Zend AMF?
    Please mark this question as answered if this works for you.
    -Mr.12

  • Problem in bdc urgent

    iam running vf46 transaction using bdc. it is an alv report .after displaying the output of a report, i need to select the line and do further process. selecting the row of alv report is not reflecting in bdc  recording.how to go about this
    how to select alv report row in background

    Shankar ,
    this is not the right to do so , first get the logic of this report then Create Upload program using BAPI's or FM's. no need to write a BDC.
    check this FM
    <b>SD_REV_REC_COLLECTIVE_RUN_NEW</b>  in that VF46.
    Regards
    prabhu

  • Error in bdc-urgent

    Hi experts,
    if i schedule my BDC(call transaction) program in sm36 it shows the error as frontend function cannot be execute in background. message number (FES002) .
    please guide me
    Thanks,
    ashok

    Hi,
    Why you want to upload the file from "Presentation Server". It is common practice to get the file from "Application Server".
    You can get the file from "Application server" using <b>OPEN DATASET</b> and <b>READ DATASET</b>.
    Check this link to see how to handle file
    http://help.sap.com/saphelp_46c/helpdata/EN/fc/eb3c72358411d1829f0000e829fbfe/frameset.htm
    Check this link for more information, how to read file from "Application server".
    http://help.sap.com/saphelp_46c/helpdata/EN/fc/eb3c7f358411d1829f0000e829fbfe/frameset.htm
    Can you please tell me why you want to read file from "Presentation Server"?I suggest you read file from "Application server".
    Regards,
    RS

  • Bdc urgent

    Hi
      This is my first BDC program t.code vl01n where in i need to pass data from selection screen insted of flat file,and i need it to pass it in ranges
    suppose at slection screen
    i.e exidv 1700000001 to 17000000066
    and similar field
    can anyone help me with this or provide me with sample coding for bdc which is passing data from selection screen in ranges.
    thanks in advance.

    Hi,
    you have the select options here
    take the difference between these two values 
    ( you can have it if it is either numeric or character  )
    so in this case it will come for 66 records,
    take an internal table.
    which will have this exidv as one of the field
    do 66 times..
    if sy-tabix  ne  1 and sy-tabix ne 66.
    itab-exidv = selop-low + sy-tabix.
    endif.
    append itab.
    enddo.
    so now in your itab all it wil have
    from
    1700000001 to 17000000066
    now loop this table and pass these values
    but declare your internal of character type...
    regards,
    Venkatesh

  • Increased Qty in sales order than the Billed qty..  urgent

    Hi folks,
    When I am creating a return sales doc. with reference to a Billing doc,
    everything is getting copied on to the return sales doc.
    The Qty of the item is also getting copied on to the sales doc.
    But when i increase the qty of the item , it is giving me a warning message  saying " Qty is more than the billed qty." and thus allowing me to take it.
    The client want that this should be an error message and hence shouldnot allowed to take the increased qty.
    Can anyone tell how to make it an error message.
    thanx
    sourav

    Hi Sourav,
                  Check copy control settings in the transaction VTAF.
    In that you go to item level copy control check the field Pos./neg.quantity whether this field set as '-' or not.
    If not set enter - (Minus) then try
    If already enter you need to go for the User exits to cahnge the warning message to error message.
    I hope it will help you
    Regards,
    Murali.

  • FBCJ BDC URGENT!!

    Hi,
    I'm doing BDC of fbcj.
    But one information message comes as soon as i run my BDC.
    S Field ISCJ_E_POSTINGS-H_PAYMENTS (1) input value is longer than screen field.
    and my amount is not coming there due to this msg.
    How to do this??
    Thanks,
    Gaurav

    Hi Sam
    It would be better if we can get the detailed info of the problem. well anyway I will try answering ur Question....
    The bestthing while doing a BDC is as said by others, thats Doing a Recording of the transaction used through TCODE 'SHDB'. here you get all the scrren numbers and source program name.
    and regarding the part of code you mentioned
    '' The below screen is not there for change info record.
    '' But I need to update for changing info record.
    PERFORM bdc_screen USING 'SAPMM06I' '103'.
    PERFORM bdc_table USING 'RM06I-SELKZ(01)' 'X'.
    PERFORM bdc_table USING 'RM06I-LTEX1(01)' int_me12-ztd.
    it all depends on the requirement of the change. we would have not given a field while creating a record but may have to change it if required so is this LTEX1 which you are changing also there while creating? I guess not as the code for the same is missing

  • HI REGORDING BDC URGENT

    HI
    EXPERTS CAN U HELP ME FOR THIS
    <b>IF  SUPPOSE THERE ARE 10 RECORDS IN FLATFILE THEN HOW MANY TIMES BDC_OPEN_GROUP.BDC_INSERT,BDC_CLOSE_GROUP EXCUTED
    </b>

    Hi!
    During the recording, you might try out the following:
    - fill in the first 5 bank accounts (with the right row indexes (ROW(1), ROW(2), etc..))
    - press a PAGEDOWN button
    - fill in the next 4 accounts
    - press PAGEDOWN again
    - fill the rest...
    Regards
    Tamá

  • Urgent qty issue more

    hi expert
    my issue is as.vendor sent goods 3900, in GR they have done for4000 in plant(a)
    this plant deliver the goods to plant(b)4000 and billing qty is also 4000.my issue is i wants to take back qty100 back and .how to reverse is qty plz suggest
    urgent
    points will be awarded

    hi expert i wants to add on thing plant(b)actually receipt3900
    qty.how to match difference

  • Sales order status showing Completed, after I do partial delivery

    Dear All, Good morning
    I'm Creating an order for 5 quantities and creating a delivery for 2 Qty',
    my problem here is the sales order status is showing complete and I'm unable to create a delivery for the remaining Qty.
    I've checked with the Copy controls for OR - LR(T.code: VTLA) , for your reference I'm showing it below,
    FOR HEADER
    Target delivery type    LF     Outbound Delivery
    From SalesDoc Type      OR     Standard Order
    Order requirements     001    Header
    Combination requirmt   051    Combination
    Header Data            001    Header
    Header Data Ext. Sys   0
    Handling Units         000
    Copy Item Number is not CHECKED
    FOR ITEM
    Target delivery type    LF     Outbound Delivery
    From SalesDoc Type      OR     Standard Order
    Order requirements     001    Header
    Combination requirmt   051    Combination
    Header Data            001    Header
    Header Data Ext. Sys   0
    Handling Units         000
    Update Document Flow is CHECKED & Positive/Negative Qty
    Please its urgent.
    Thanks & Regards

    hello, friend.
    in addition to what the others have said, please check your customer master, particularly in the Sales Area Data > Shipping tab.  look at the partial deliveries.  there may have been settings that tell the system if a delivery has been created with reference to the sales order, the order will be completed even if the quantity is only partially delivered.  if the entry in the 'partial delivery per item' field is 'B', then this will explain your situation.
    this can also be manually set in the sales order, so you have to take a look at the order as well, at item level.
    regards.

  • Tag numbers issue

    Dear all
    Tag number is shown in the assets(i.e Financial Informaton). But the tag number is not shown in on Hand qty. Its Urgent
    Kindly update it
    Regard
    Arifuddin
    Edited by: user11309801 on Feb 11, 2011 1:34 AM

    Having raised a service request with Oracle, it would seem that this is not possible -
    "Unfortunately, In the BIP core, there is no functionality to test that a file ( containing an image ) exists or not ."
    The problem I have is that the URL referencing the image is concatenated and includes the XML item for a reference number. That reference number, and therefore the XML item, is always available but the image that corresponds to it is not - so I can't test for a null or false return because BI Publisher does not recognise the concatenated string of the url as having a returned value.
    This would be a problem if the layout options in Word were more flexible (better) - being able to add an image to the background of a table or cell would have solved my problem but, sadly, that is not possible in the version of Word I'm using (2003). I'm not sure whether it's possible in newer versions though?

  • Need help in bdc its urgent

    hai friends
    my reequirement is extracting data from 4.6 c for  purchase order me21 into flat file format.(tab delimitter) .currently we are working on ecc 6 version.i had already written bdc code for me21 in ecc6 version for uploading data.
    please help me its urgent.
    give any sample code for writing extract program

    Hi Friend,
    if it help full to u please give me max point.i am sending code.
    REPORT ZMXX0295 LINE-SIZE 132 NO STANDARD PAGE HEADING.
    +
    Comparisom of PIR or Contract price with latest PO price
    +
    This program was created to compare PIR prices or contract prices
    with the latest PO price.
    It reads the source lists for the specified materials to determine
    the PIR or contract prices. Afterwards it reads the PO history to
    get the purchase order prices.
    The material to be processed can either be selected from the data
    base (material master) or via an PC upload file.
    The output can be sorted in different variants.
    +
    +
    *eject
    Definition of database tables --------------------------------------+
    TABLES: EINA,                     "Purchasing Info Record: General Data
            EINE,                     "PIR: Purchasing Organization Data
            EIPA,                     "Order Price History, Info Record
            EKAB,                     "Contract Release Documentation
            *EKKO,                    "Contract / PO header
            EKKO,                     "Contract / PO header
            *EKPO,                    "Contract / PO item
            EKPO,                     "Contract / PO item
            EORD,                     "Source list
            TCURC.                    "Currency codes
    *eject
    Definition of internal tables / data -------------------------------+
    DATA: BEGIN OF MAT_PRICE OCCURS 0,
            VRTYP LIKE EORD-VRTYP,                   "Document type
            INFNR LIKE EINE-INFNR,                   "Info record / Contract
            MATNR LIKE EINA-MATNR,                   "Material
            WERKS LIKE EINE-WERKS,                   "Plant
            EKORG LIKE EINE-EKORG,                   "Purch. organization
            LIFNR LIKE EINA-LIFNR,                   "Vendor
            FLIFN LIKE EORD-FLIFN,                   "Fix Vendor
            IRPRS LIKE EINE-NETPR,                   "Info record price
            PEINH LIKE EINE-PEINH,                   "Price unit
            EBELN LIKE EIPA-EBELN,                   "PO header
            EBELP LIKE EIPA-EBELP,                   "PO item
            BEDAT LIKE EIPA-BEDAT,                   "PO date
            POPRS LIKE EIPA-LPREI,                   "PO price
            LPEIN LIKE EIPA-LPEIN,                   "Price unit
            MENGE LIKE EKPO-MENGE,                   "PO quantity
            MEINS LIKE EKPO-MEINS,                   "PO unit of measure
          END OF MAT_PRICE.
    DATA: BEGIN OF MAT_SEL OCCURS 0,
            MATNR LIKE EINA-MATNR,
          END OF MAT_SEL.
    DATA: T_EORD LIKE EORD OCCURS 0 WITH HEADER LINE.
    DATA: CURSORFIELD(15),                           "Fieldname of Cusor pos
          INV_DATE LIKE SY-DATUM,                    "Inverted date
          W_EFFPR  LIKE EINE-EFFPR.                  "Hiwi price
    DATA: W_FILE TYPE STRING.                        "JAN29NOV05
    CONSTANTS: C_0(01)    TYPE C VALUE '0',
               C_F(01)    TYPE C VALUE 'F',
               C_I(01)    TYPE C VALUE 'I',
               C_K(01)    TYPE C VALUE 'K',
               C_X(01)    TYPE C VALUE 'X'.
    CONSTANTS: C_ASC(10) TYPE C VALUE 'ASC'.           "JAN29NOV05
    *eject
    Definition of selection screen -------------------------------------+
    SELECTION-SCREEN BEGIN OF BLOCK B01 WITH FRAME TITLE TEXT-B01.
    PARAMETERS:     P_DBASE RADIOBUTTON GROUP R01.   "Read mat's via select.
    SELECT-OPTIONS: S_MATNR FOR EINA-MATNR.          "Material
    SELECTION-SCREEN ULINE.
    PARAMETERS:     P_XFILE RADIOBUTTON GROUP R01,   "Read mat's via PC file
                    P_DATEI LIKE RLGRAP-FILENAME.    "PC file with MATNR's
    SELECTION-SCREEN SKIP.
    SELECT-OPTIONS: S_MATKL FOR  EINA-MATKL,         "Material group
                    S_WERKS FOR  EINE-WERKS,         "Plant
                    S_EKORG FOR  EINE-EKORG,         "Purch. organization
                    S_BEDAT FOR  EIPA-BEDAT.         "PO price date
    PARAMETERS:     P_WAERS LIKE EINE-WAERS          "Output currency
                            OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK B01.
    *eject
    Process after input ------------------------------------------------+
    AT SELECTION-SCREEN ON P_WAERS.
      PERFORM READ_TCURC.
    AT SELECTION-SCREEN ON P_DATEI.
      IF NOT P_XFILE IS INITIAL
         AND P_DATEI IS INITIAL.
        MESSAGE E999(ZZ) WITH 'Please sepcify PC file name'.
      ENDIF.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_DATEI.
      PERFORM CALL_WS_EXPLORER.
    *eject
    Start of main program ----------------------------------------------+
    START-OF-SELECTION.
       IF NOT P_XFILE IS INITIAL.
         PERFORM UPLOAD_MATERIAL_SELECTION.          "Read mat's from file
         IF MAT_SEL[] IS INITIAL.
           MESSAGE E999(ZZ) WITH
                  'No records were found in file'(E01) P_DATEI(40).
         ELSE.
           PERFORM GET_MATERIAL_SELECTION.           "Process upload file
         ENDIF.
       ENDIF.
       PERFORM SOME_REWORK.
       PERFORM PROCESS_MATERIALS.                    "Process mat. selection
    END-OF-SELECTION.
    End of Main program ------------------------------------------------+
      SET PF-STATUS 'LIST'.
      SORT MAT_PRICE BY MATNR WERKS EKORG POPRS.
      PERFORM AUSGABE.
      IF SY-SUBRC EQ 0.
        MESSAGE I999(ZZ) WITH TEXT-002.
        MESSAGE S999(ZZ) WITH TEXT-001
                'Material/Plant/PurchOrg/PO Price'(003).
      ENDIF.
    *eject
    User commands - interactive reporting ...
      AT USER-COMMAND.
        IF SY-UCOMM EQ 'ORDR'.
          PERFORM DISPLAY_ORDER.
        ENDIF.
      AT LINE-SELECTION.
        PERFORM CHANGE_SORT_SEQUENCE.
    *eject
    +
          TOP-OF-PAGE
    +
    TOP-OF-PAGE.
      PERFORM LIST_HEADER.
    *eject
    +
          TOP-OF-PAGE during line-selection.
    +
    TOP-OF-PAGE DURING LINE-SELECTION.
      PERFORM LIST_HEADER.
    *eject
          Form  CALL_WS_EXPLORER
    FORM CALL_WS_EXPLORER.
      CALL FUNCTION 'WS_FILENAME_GET'
         EXPORTING
            DEF_FILENAME     = '*.txt,'  "JAN29NOV05
              DEF_FILENAME     = '*.txt'   "JAN29NOV05
              DEF_PATH         = 'D:\'
              MASK             =
                  Block Changed From Here JAN29NOV05
                  'Text files,.txt,Data files,.dat,All files,.,.'(MSK)
                    ' Text files,.txt,Data files,.dat,All files,.,.'(MSK)
                  Block Changed Till Here JAN29NOV05
              MODE             = 'O'
              TITLE            = 'Upload Materials to be processed'(004)
         IMPORTING
              FILENAME         = P_DATEI
         EXCEPTIONS
              INV_WINSYS       = 1
              NO_BATCH         = 2
              SELECTION_CANCEL = 3
              SELECTION_ERROR  = 4.
    ENDFORM.                    " CALL_WS_EXPLORER
    *eject
          Form  PROCESS_MATERIALS
          Read source list for specified materials and then process
          either PIR or contracts.
    FORM PROCESS_MATERIALS.
      PERFORM READ_MATERIAL_SOURCE_LIST.
      LOOP AT T_EORD.
        CLEAR W_EFFPR.
        TRANSLATE T_EORD-VRTYP USING ' I'.           "Set I = Infor record
        IF T_EORD-VRTYP EQ C_I.
          PERFORM GET_PIR_INFORMATION.
        ELSE.
          T_EORD-FLIFN = T_EORD-FEBEL.
          PERFORM GET_CONTRACT_INFORMATION.
        ENDIF.
      ENDLOOP.
    ENDFORM.                    " PROCESS_MATERIALS
    *eject
          Form  GET_MATERIAL_SELECTION
    FORM GET_MATERIAL_SELECTION.
      SORT MAT_SEL.
      CLEAR S_MATNR.
      S_MATNR-OPTION = 'EQ'.
      S_MATNR-SIGN   = 'I'.
      LOOP AT MAT_SEL WHERE
           MATNR CO ' 0123456789'.
        SHIFT MAT_SEL-MATNR RIGHT DELETING TRAILING ' '.
        TRANSLATE MAT_SEL-MATNR USING ' 0'.
        S_MATNR-LOW = MAT_SEL-MATNR.
        APPEND S_MATNR.
      ENDLOOP.
    ENDFORM.                    " GET_MATERIAL_SELECTION
          Form  READ_EIPA
    FORM READ_EIPA.
      SELECT EBELN EBELP BEDAT
             INTO CORRESPONDING FIELDS OF EIPA
             FROM EIPA
             UP TO 1 ROWS
             WHERE INFNR EQ EINA-INFNR
             AND   WERKS EQ T_EORD-WERKS
             AND   EKORG EQ T_EORD-EKORG
             AND   BEDAT IN S_BEDAT
             ORDER BY BEDAT DESCENDING.
        PERFORM READ_ADDITIONAL_PO_DATA
                USING EIPA-EBELN EIPA-EBELP.
        CHECK SY-SUBRC EQ 0.
        PERFORM FILL_MAT_PRICE USING 'X' EINA-INFNR
                EINE-EFFPR EINE-PEINH EINE-WAERS.
        APPEND MAT_PRICE.
      ENDSELECT.
    ENDFORM.                    " READ_EIPA
    *eject
          Form  FILL_MAT_PRICE
    FORM FILL_MAT_PRICE USING
    *ID X_EBELN X_EFFPR X_PEINH X_WAERS                  "JAN29NOV05
       Block added from here JAN29NOV05
                               ID      TYPE C
                               X_EBELN TYPE C
                               X_EFFPR TYPE EINE-EFFPR
                               X_PEINH TYPE EINE-PEINH
                               X_WAERS TYPE EINE-WAERS.
       Block added till here JAN29NOV05
      CLEAR MAT_PRICE.
      IF X_WAERS NE P_WAERS.
        PERFORM CONVERT_TO_OTHER_CURRENCY USING
                X_EFFPR X_WAERS P_WAERS.
      ENDIF.
      MAT_PRICE-VRTYP = T_EORD-VRTYP.                "PIR / Contract no.
      MAT_PRICE-INFNR = X_EBELN.                     "PIR / Contract no.
      MAT_PRICE-MATNR = T_EORD-MATNR.                "Material
      MAT_PRICE-LIFNR = T_EORD-LIFNR.                "Vendor
      MAT_PRICE-FLIFN = T_EORD-FLIFN.                "Fix Vendor
      MAT_PRICE-WERKS = T_EORD-WERKS.                "Plant
      MAT_PRICE-EKORG = T_EORD-EKORG.                "Purch. organization
      MAT_PRICE-IRPRS = X_EFFPR.                     "PIR / Contract price
      MAT_PRICE-PEINH = X_PEINH.                     "PIR / Contract pr.unit
      CHECK ID NE SPACE.                             "PO history found ?
    latest PO data ...
      IF EKKO-WAERS NE P_WAERS.
        PERFORM CONVERT_TO_OTHER_CURRENCY USING
                EKPO-EFFWR EKKO-WAERS P_WAERS.
      ENDIF.
      MAT_PRICE-EBELN = EKPO-EBELN.                  "PO number
      MAT_PRICE-EBELP = EKPO-EBELP.                  "PO item
      MAT_PRICE-BEDAT = EKKO-BEDAT.                  "PO date
      IF EKPO-MENGE NE 0.
        MAT_PRICE-POPRS = EKPO-EFFWR / ( EKPO-MENGE  "Last PO price = value
    EKPO-BPUMZ / EKPO-BPUMN ). " / Qty. in sales unit
      ELSE.
        MAT_PRICE-POPRS = EKPO-EFFWR.                "Last PO value
      ENDIF.                                         "PO price unit
      MAT_PRICE-LPEIN = EKPO-PEINH.                  "PO price unit
      MAT_PRICE-MENGE = EKPO-MENGE.                  "PO quantity
      MAT_PRICE-MEINS = EKPO-MEINS.                  "PO unit of measure
    ENDFORM.                    " FILL_MAT_PRICE
    *eject
          Form  CONVERT_TO_OTHER_CURRENCY
    FORM CONVERT_TO_OTHER_CURRENCY USING
                           XVALUE FR_CURR TO_CURR.     "JAN29NOV05
       Block added from here JAN29NOV05
                               XVALUE  TYPE ANY
                               FR_CURR TYPE EKKO-WAERS
                               TO_CURR TYPE EINE-WAERS.
       Block added till here JAN29NOV05
      CALL FUNCTION 'MS_CONVERT_TO_OTHER_CURRENCY'
           EXPORTING
                DATE             = SY-DATUM
                FROM_CURRENCY    = FR_CURR
                FROM_AMOUNT      = XVALUE
                TO_CURRENCY      = TO_CURR
                COMPANY_CURRENCY = 'EUR'
           IMPORTING
                TO_AMOUNT        = XVALUE
           EXCEPTIONS
                OTHERS           = 1.
      IF SY-SUBRC NE 0.
        MESSAGE E999(ZZ) WITH 'Currency conversion error from'(E02)
                              FR_CURR 'to' TO_CURR.
      ENDIF.
    ENDFORM.                    " CONVERT_TO_OTHER_CURRENCY
    *eject
          Form  UPLOAD_MATERIAL_SELECTION
    FORM UPLOAD_MATERIAL_SELECTION.
       Block commented from here JAN29NOV05
    CALL FUNCTION 'WS_UPLOAD'
          EXPORTING
               FILENAME            = P_DATEI
               FILETYPE            = 'DAT'
          TABLES
               DATA_TAB            = MAT_SEL
          EXCEPTIONS
               CONVERSION_ERROR    = 1
               FILE_OPEN_ERROR     = 2
               FILE_READ_ERROR     = 3
               INVALID_TABLE_WIDTH = 4
               INVALID_TYPE        = 5
               NO_BATCH            = 6
               UNKNOWN_ERROR       = 7
               OTHERS              = 8.
       Block commented till here JAN29NOV05
       Block added from here JAN29NOV05
      MOVE P_DATEI TO W_FILE.
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
       FILENAME                      =  W_FILE
       FILETYPE                      =  C_ASC
       HAS_FIELD_SEPARATOR           =  C_X
      TABLES
        DATA_TAB                     = MAT_SEL
    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.
       Block added till here JAN29NOV05
      IF SY-SUBRC NE 0.
        MESSAGE E999(ZZ) WITH 'Error uploading from file'
                         P_DATEI(40).
      ENDIF.
    ENDFORM.                    " UPLOAD_MATERIAL_SELECTION
    *eject
          Form  AUSGABE
    FORM AUSGABE.
      LOOP AT MAT_PRICE.
        FORMAT COLOR 1 INTENSIFIED OFF.
        WRITE: /01 MAT_PRICE-VRTYP,                  "Document type
                03 MAT_PRICE-INFNR,                  "Info record / Contract
                14 MAT_PRICE-MATNR,                  "Material
                23 MAT_PRICE-WERKS,                  "Plant
                28 MAT_PRICE-EKORG,                  "Purch. organization
                33 MAT_PRICE-LIFNR,                  "Vendor
                44 MAT_PRICE-FLIFN,                  "Fixed Vendor
                46 MAT_PRICE-IRPRS NO-SIGN,          "Info record price
                61 MAT_PRICE-PEINH NO-SIGN.          "IR price unit
        FORMAT COLOR 2 INTENSIFIED.
        IF NOT MAT_PRICE-EBELN IS INITIAL.
          WRITE:  68 MAT_PRICE-POPRS NO-SIGN,        "PO price
                  83 MAT_PRICE-LPEIN NO-SIGN,        "PO price unit
                  90 MAT_PRICE-MENGE,                "PO quantity
                 107 MAT_PRICE-MEINS,                "PO unit of measure
                 111 MAT_PRICE-EBELN,                "PO number
                 123 MAT_PRICE-BEDAT.                "PO date
        ELSE.
          WRITE:  74 'No PO price was found'(005),
                 132 ' '.
        ENDIF.
        HIDE MAT_PRICE-VRTYP.
        AT END OF MATNR.
          SKIP.
        ENDAT.
      ENDLOOP.
      CLEAR MAT_PRICE.
    ENDFORM.                    " AUSGABE
    *eject
          Form  READ_TCURC
    FORM READ_TCURC.
      CLEAR TCURC.
      TCURC-WAERS = P_WAERS.
      READ TABLE TCURC.
      IF SY-SUBRC NE 0.
        MESSAGE E999(ZZ) WITH P_WAERS 'Currency code invalid'(E03).
      ENDIF.
    ENDFORM.                    " READ_TCURC
    *eject
          Form  LIST_HEADER
    FORM LIST_HEADER.
      FORMAT INTENSIFIED.
      WRITE: /01 'Output currency'(006), 25 ': ', P_WAERS,
             122 'Page'(007), SY-PAGNO,
             /01 'Plant'(008), 25 ':  from '(009), S_WERKS-LOW,
              46 'to '(010), S_WERKS-HIGH,
             /01 'Purchasing Organization'(011),
              25 ':  from '(009), S_EKORG-LOW,
              46 'to '(010), S_EKORG-HIGH,
             /01 'PO date'(012), 25 ':  from '(009), S_BEDAT-LOW,
              46 'to '(010), S_BEDAT-HIGH.
      ULINE.
      FORMAT COLOR 1.
      WRITE: /01 TEXT-T01.
      ULINE.
    ENDFORM.                    " LIST_HEADER
    *eject
          Form  CHANGE_SORT_SEQUENCE
    FORM CHANGE_SORT_SEQUENCE.
      GET CURSOR FIELD CURSORFIELD.
      CASE CURSORFIELD+10(5).
        WHEN 'EKORG'.
          SORT MAT_PRICE BY MATNR EKORG POPRS.
          PERFORM AUSGABE.
          MESSAGE S999(ZZ) WITH TEXT-001
                  'Material/Purch.Organization/Info Rec.Price'(013).
        WHEN 'BEDAT'.
          SORT MAT_PRICE BY MATNR BEDAT POPRS.
          PERFORM AUSGABE.
          MESSAGE S999(ZZ) WITH TEXT-001
                  'Material/PO Date/Info Rec.Price'(014).
        WHEN 'IRPRS'.
          SORT MAT_PRICE BY MATNR IRPRS.
          PERFORM AUSGABE.
          MESSAGE S999(ZZ) WITH TEXT-001
                  'Material/Plant/Info Rec.Price'(015).
        WHEN 'POPRS'.
          SORT MAT_PRICE BY MATNR POPRS.
          PERFORM AUSGABE.
          MESSAGE S999(ZZ) WITH TEXT-001
                  'Material/Plant/PO Price'(016).
        WHEN 'LIFNR'.
          SORT MAT_PRICE BY MATNR LIFNR POPRS.
          PERFORM AUSGABE.
          MESSAGE S999(ZZ) WITH TEXT-001
                  'Material/Vendor/PO Price'(017).
        WHEN OTHERS.
          SORT MAT_PRICE BY MATNR WERKS EKORG POPRS.
          PERFORM AUSGABE.
          MESSAGE S999(ZZ) WITH TEXT-001
                  'Material/Plant/PurchOrg/PO Price'(018).
      ENDCASE.
      SY-LSIND = 0.
    ENDFORM.                    " CHANGE_SORT_SEQUENCE
    *eject
          Form  DISPLAY_ORDER
    FORM DISPLAY_ORDER.
      DATA: X_BELNR(10) TYPE C.
      CLEAR CURSORFIELD.
      GET CURSOR FIELD CURSORFIELD.
      IF CURSORFIELD+10(5) NE 'EBELN' AND
         CURSORFIELD+10(5) NE 'INFNR'.
        MESSAGE I999(ZZ) WITH 'Invalid cursor position'.
        EXIT.
      ENDIF.
      GET CURSOR FIELD CURSORFIELD  VALUE X_BELNR.
      CASE CURSORFIELD+10(5).
        WHEN 'EBELN'.                                "Purchase order
          SET PARAMETER ID 'BES' FIELD X_BELNR.
          CALL TRANSACTION 'ME23' AND SKIP FIRST SCREEN.
        WHEN 'INFNR'.                                "Info rec. / Contract
          IF MAT_PRICE-VRTYP EQ C_I.                 "Info Record ...
            SET PARAMETER ID 'INF' FIELD X_BELNR.
            CALL TRANSACTION 'ME13' AND SKIP FIRST SCREEN.
          ELSE.                                      "Contract ...
            SET PARAMETER ID 'VRT' FIELD X_BELNR.
            CALL TRANSACTION 'ME33' AND SKIP FIRST SCREEN.
          ENDIF.
      ENDCASE.
      CLEAR MAT_PRICE.
    ENDFORM.
    *eject
          Form  SOME_REWORK
    FORM SOME_REWORK.
       IF NOT S_BEDAT-LOW IS INITIAL AND             "Align date for output
          S_BEDAT-HIGH IS INITIAL.
         S_BEDAT-HIGH = S_BEDAT-LOW.
         MODIFY S_BEDAT INDEX 1.
       ENDIF.
       CONVERT DATE SY-DATUM INTO INVERTED-DATE      "today's inverted date
               INV_DATE.
    ENDFORM.                    " SOME_REWORK
    *eject
          Form  READ_ADDITIONAL_PO_DATA
    FORM READ_ADDITIONAL_PO_DATA USING
                                  X_EBELN X_EBELP.  "JAN29NOV05
       Block added from here JAN29NOV05
                                    X_EBELN TYPE EIPA-EBELN
                                    X_EBELP TYPE EIPA-EBELP.
       Block added till here JAN29NOV05
      SELECT SINGLE WAERS BEDAT
             INTO CORRESPONDING FIELDS OF EKKO
             FROM EKKO
             WHERE EBELN EQ X_EBELN.
      SELECT SINGLE EBELN EBELP MENGE MEINS
                    PEINH EFFWR BPUMZ BPUMN
             INTO CORRESPONDING FIELDS OF EKPO
             FROM EKPO
             WHERE EBELN EQ X_EBELN
             AND   EBELP EQ X_EBELP
             AND   LOEKZ NE 'L'.
    ENDFORM.                    " READ_ADDITIONAL_PO_DATA
    *eject
          Form  READ_MATERIAL_SOURCE_LIST
          Read source list entries for specified materials
    FORM READ_MATERIAL_SOURCE_LIST.
      SELECT * INTO CORRESPONDING FIELDS OF TABLE T_EORD
             FROM EORD
             WHERE MATNR IN S_MATNR
             AND   WERKS IN S_WERKS
             AND   EKORG IN S_EKORG
             AND   VDATU LE SY-DATUM
             AND   BDATU GE SY-DATUM
             AND ( VRTYP EQ SPACE
             OR    VRTYP EQ C_K ).
      IF SY-SUBRC NE 0 OR
         T_EORD[] IS INITIAL.
        MESSAGE S999(ZZ) WITH 'No data found for this selection'(S01).
      ENDIF.
    ENDFORM.                    " READ_MATERIAL_SOURCE_LIST
    *eject
          Form  GET_PIR_INFORMATION
          Process purchase info records --> purchase order history
    FORM GET_PIR_INFORMATION.
      SELECT INFNR
             INTO EINA-INFNR
             FROM EINA
             WHERE LIFNR EQ T_EORD-LIFNR
             AND   MATNR EQ T_EORD-MATNR
             AND   MATKL IN S_MATKL
             AND   LOEKZ EQ SPACE.
        SELECT SINGLE EFFPR PEINH WAERS
               INTO CORRESPONDING FIELDS OF EINE
               FROM EINE
               WHERE INFNR EQ EINA-INFNR
               AND   EKORG EQ T_EORD-EKORG
               AND   ESOKZ EQ C_0
               AND   WERKS EQ T_EORD-WERKS
               AND   LOEKZ EQ SPACE.
        CHECK SY-SUBRC EQ 0.
        PERFORM READ_EIPA.                           "Read PO history
        IF SY-SUBRC NE 0.
          PERFORM FILL_MAT_PRICE USING ' ' EINA-INFNR
                  EINE-EFFPR EINE-PEINH EINE-WAERS.
          APPEND MAT_PRICE.
        ENDIF.
      ENDSELECT.
    ENDFORM.                    " GET_PIR_INFORMATION
    *eject
          Form  GET_CONTRACT_INFORMATION
          text
    FORM GET_CONTRACT_INFORMATION.
      SELECT SINGLE WAERS
             INTO *EKKO-WAERS
             FROM EKKO
             WHERE EBELN EQ T_EORD-EBELN
             AND   LOEKZ EQ SPACE.
      SELECT SINGLE EBELN EBELP EFFWR PEINH
                    KTMNG BPUMZ BPUMN
             INTO CORRESPONDING FIELDS OF *EKPO
             FROM EKPO
             WHERE EBELN EQ T_EORD-EBELN
             AND   EBELP EQ T_EORD-EBELP
             AND   LOEKZ EQ SPACE.
      CHECK SY-SUBRC EQ 0.
    Get effective price in sales unit ...
      IF *EKPO-KTMNG EQ 0 OR
         *EKPO-BPUMN EQ 0.
        W_EFFPR = *EKPO-EFFWR.
      ELSE.
        W_EFFPR = *EKPO-EFFWR / *EKPO-KTMNG
    *EKPO-BPUMZ / *EKPO-BPUMN.
      ENDIF.
      PERFORM READ_EKAB.
      IF SY-SUBRC NE 0.
        PERFORM FILL_MAT_PRICE USING ' ' *EKPO-EBELN
                W_EFFPR *EKPO-PEINH *EKKO-WAERS.
        APPEND MAT_PRICE.
      ENDIF.
    ENDFORM.                    " GET_CONTRACT_INFORMATION
    *eject
          Form  READ_EKAB
          Read released document (PO's) of contract
    FORM READ_EKAB.
      SELECT EBELN EBELP BEDAT
             INTO CORRESPONDING FIELDS OF EKAB
             FROM EKAB
             UP TO 1 ROWS
             WHERE KONNR EQ T_EORD-EBELN
             AND   KTPNR EQ T_EORD-EBELP
             AND   WERKS EQ T_EORD-WERKS
             AND   EKORG EQ T_EORD-EKORG
             AND   BEDAT IN S_BEDAT
             AND   BSTYP EQ C_F
             ORDER BY BEDAT DESCENDING.
        PERFORM READ_ADDITIONAL_PO_DATA
                USING EKAB-EBELN EKAB-EBELP.
        CHECK SY-SUBRC EQ 0.
        PERFORM FILL_MAT_PRICE USING 'X' T_EORD-EBELN
                W_EFFPR *EKPO-PEINH *EKKO-WAERS.
        APPEND MAT_PRICE.
      ENDSELECT.
    ENDFORM.                    " READ_EKAB

  • Urgent plz BDC

    hi gurus,
    i have a problem in bdc programm there is 3 screen using transaction f-27
    there is two amount field as(wrbtr,wrbtr2)
    two screen are run fine but the 3 screen does't take data automatically from flat file plz help me its urgent see my codes and give me solution.
    TYPES: BEGIN OF it_output,
           bldat(10)  TYPE  C,           "Document Date
           blart      TYPE  bkpf-blart,  "Document Type
           bukrs      TYPE  bkpf-bukrs,  "Company Code
           budat(10)  TYPE  C,           "Posting Date
           monat      TYPE  bkpf-monat,  "Period
           waers      TYPE  bkpf-waers,  "Currency
           xblnr      TYPE  bkpf-xblnr,  "Reference Field
           docid      TYPE  fs006-docid, "Document ID
           newbs      TYPE  rf05a-newbs, "Posting  Key
           newko      TYPE  rf05a-newko, "Account Code
           wrbtr(16)  TYPE  C,           "Amount in Document currency
           zfbdt(10)  TYPE  C,           "Baseline Date
           newbs2     TYPE  rf05a-newbs, "Account Key2
           newko2     TYPE  rf05a-newko, "Account code2
           wrbtr2(16) TYPE  C,           "Amount2
           END OF it_output.
    DATA lt_output  TYPE  it_output OCCURS 0 WITH HEADER LINE.
    DATA it_bdc     LIKE  bdcdata OCCURS 0 WITH HEADER LINE.
    DATA it_messtab LIKE  bdcmsgcoll OCCURS 1 WITH HEADER LINE.
                               D A T A                                   *
    DATA: message TYPE string.
    DATA: p_file1 type string.
             S E L E C T - O P T I O N S / P A R A M E T E R S           *
    SELECTION-SCREEN BEGIN OF BLOCK block0 WITH FRAME.
    PARAMETERS : p_file  LIKE rlgrap-filename OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK block0.
             A T  S E L E C T I O N - S C R E E N                        *
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
      CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
        EXPORTING
          static    = 'X'
          mask      = space
        CHANGING
          file_name = p_file.
                   S T A R T - O F - S E L E C T I O N
    START-OF-SELECTION.
      PERFORM  upload.
      PERFORM  bdc.
      PERFORM  write_message.
    *&      Form  bdc
          text
    FORM bdc.
      LOOP AT lt_output.
        READ TABLE lt_output INDEX 1.
        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'  lt_output-bldat.
        PERFORM bdc_field       USING 'BKPF-BLART'  lt_output-blart.
        PERFORM bdc_field       USING 'BKPF-BUKRS'  lt_output-bukrs.
        PERFORM bdc_field       USING 'BKPF-BUDAT'  lt_output-budat.
        PERFORM bdc_field       USING 'BKPF-MONAT'  lt_output-monat.
        PERFORM bdc_field       USING 'BKPF-WAERS'  lt_output-waers.
        PERFORM bdc_field       USING 'BKPF-XBLNR'  lt_output-xblnr.
        PERFORM bdc_field       USING 'FS006-DOCID' lt_output-docid.
        PERFORM bdc_field       USING 'RF05A-NEWBS' lt_output-newbs.
        PERFORM bdc_field       USING 'RF05A-NEWKO' lt_output-newko.
        PERFORM bdc_dynpro      USING 'SAPMF05A' '0302'.
        PERFORM bdc_field       USING 'BDC_CURSOR' 'RF05A-NEWKO'.
        PERFORM bdc_field       USING 'BDC_OKCODE' '/00'.
        PERFORM bdc_field       USING 'BSEG-WRBTR'  lt_output-wrbtr.
        PERFORM bdc_field       USING 'BSEG-ZFBDT'  lt_output-zfbdt.
        PERFORM bdc_field       USING 'RF05A-NEWBS' lt_output-newbs2."newbs2
        PERFORM bdc_field       USING 'RF05A-NEWKO' lt_output-newko2."newko2
        PERFORM bdc_dynpro      USING 'SAPMF05A' '0301'.
        PERFORM bdc_field       USING 'BDC_CURSOR' 'BSEG-WRBTR'.
        PERFORM bdc_field       USING 'BDC_OKCODE' '=BU'.
        PERFORM bdc_field       USING 'BSEG-WRBTR'  lt_output-wrbtr2."wrbtr2
       PERFORM bdc_field       USING 'BSEG-MWSKZ' '**'.
       PERFORM bdc_field       USING 'BSEG-ZTERM' 'C007'.
       PERFORM bdc_field       USING 'BSEG-ZBD1T' '7'.
        CALL TRANSACTION 'F-27' USING it_bdc mode 'A'
                               MESSAGES INTO it_messtab.
        CLEAR it_bdc. REFRESH it_bdc.
      ENDLOOP.
    ENDFORM.                    "bdc
    *&      Form  write_message
          text
    FORM write_message.
      LOOP AT it_messtab .
        CLEAR message.
        CALL FUNCTION 'FORMAT_MESSAGE'
          EXPORTING
            id   = sy-msgid
            lang = 'EN'
            no   = sy-msgno
            v1   = sy-msgv1
            v2   = sy-msgv2
            v3   = sy-msgv3
            v4   = sy-msgv4
          IMPORTING
            msg  = message.
        CASE it_messtab-msgtyp.
          WHEN 'S'.
            WRITE:/ message.
            CLEAR message.
          WHEN 'E'.
            FORMAT COLOR 6 ON.
            WRITE:/ message.
            CLEAR message.
        ENDCASE.
      ENDLOOP.
    ENDFORM.                    "write_message
          FORM BDC_DYNPRO                                               *
    -->  PROGRAM                                                       *
    -->  DYNPRO                                                        *
    FORM bdc_dynpro USING program dynpro.
      it_bdc-program  = program.
      it_bdc-dynpro   = dynpro.
      it_bdc-dynbegin = 'X'.
      APPEND it_bdc.
      CLEAR it_bdc.
    ENDFORM.                    "BDC_DYNPRO
          FORM                                                          *
    FORM bdc_field USING fnam fval.
      it_bdc-fnam = fnam.
      it_bdc-fval = fval.
      APPEND it_bdc.
      CLEAR it_bdc.
    ENDFORM.                    "BDC_FIELD
    *&      Form  upload
          text
    -->  p1        text
    <--  p2        text
    FORM upload .
    p_file1 = p_file.
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        filename                      = p_file1
       FILETYPE                      = 'DAT'
      tables
        data_tab                      = lt_output
    EXCEPTIONS
      FILE_OPEN_ERROR               = 1
      FILE_READ_ERROR               = 2
      NO_BATCH                      = 3
      GUI_REFUSE_FILETRANSFER       = 4
      INVALID_TYPE                  = 5
      NO_AUTHORITY                  = 6
      UNKNOWN_ERROR                 = 7
      BAD_DATA_FORMAT               = 8
      HEADER_NOT_ALLOWED            = 9
      SEPARATOR_NOT_ALLOWED         = 10
      HEADER_TOO_LONG               = 11
      UNKNOWN_DP_ERROR              = 12
      ACCESS_DENIED                 = 13
      DP_OUT_OF_MEMORY              = 14
      DISK_FULL                     = 15
      DP_TIMEOUT                    = 16
      OTHERS                        = 17
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDFORM.                    " upload
    i am also send u my flat file the client says that in amount filed of 3rd screen we will give the * asterick or other amount plz take it.
    thank
    plz help me.
    jay
    Edited by: jayant kumar on Apr 30, 2008 12:42 PM

    hi jayant,
    Declare '**'  as a character constant and pass this constant to the Subroutine.
    data : c_astrick type char2 value '**'.
    PERFORM bdc_field USING 'BSEG-MWSKZ c_astrick.
    Reward points if it is helpful.
    Regards,
    srilatha.

Maybe you are looking for

  • Actual Finish date and time

    Hii How can we set the actual finish date and time to be logged at the time of Technical completion ??  Thanks and Regards BK

  • Self Service Purchasing 5 and Win XP Pro

    Hi, Just like to ask, can SSP5 run on WIN XP Pro? Cheers Jerry

  • Preflight Help in InDesign CS5

    I am having a problem in InDesign with image errors in the preflight. It says, "content generates cyan, magenta, or yellow plate", it then says I must fix them to a CMYK. The company I am designing this for requires I use RGB images. So, my question

  • Find / Highlight limitations or bug?

    I have SQL Developer 3.1 installed on my PC, and am finding the 'Find/Highlight' rather restrictive. Not sure if this is just a limitation, or whether it is a bug. for example, I can query individual numbers, dates, strings, and date ranges (i.e. > '

  • PICTURES WON'T FLIP

    If I hold my phone to flip the photos to landscape view, it won't flip. Any ideas?