BDC Probelm

Hi,
No one is responding to my question, iam struck up with my work, pls helpme.
1) iam getting open items into IT_BSIS table and uplaoding all the open items to (f-04) for thta iam using BSEG table.
Actually in IT_DOcNO i can popualte BELNR(document number ) only, where i need to get records based on AUGBL(clearing doc no), for getting line items.
How to change this.
SELECT bldat
         budat
         bukrs
         waers
         monat
         blart
         hkont
         belnr
         bschl
       pswbt
         wrbtr
         valut
         FROM bsis
         INTO TABLE it_bsis
         WHERE bukrs EQ p_bukrs
         AND hkont EQ p_hkont.
       AND valut GE p_bldat.
delete  it_bsis where belnr ='4200000072'.
  IF NOT it_bsis[] IS INITIAL.
    LOOP AT it_bsis.
          PERFORM fill_screen_data.
      CALL TRANSACTION 'F-04' USING bdcdata MODE 'N' UPDATE 'S'
                                  MESSAGES INTO it_bdcmsgcoll.
     IF sy-subrc EQ 0.
        it_docno-belnr = it_bsis-belnr.
        APPEND it_docno.
        CLEAR it_docno.
      ELSE.
         perform error_msg_text.
         it_ermsg-belnr = it_bsis-belnr.
         it_ermsg-ertxt = v_ertxt.
         append it_ermsg.
         clear: it_ermsg, it_bdcmsgcoll.
      endif.
      REFRESH bdcdata.
      CLEAR BDCDATA.
      CLEAR it_bsis.
    ENDLOOP.
  ENDIF.
*SORT it_docno BY belnr.
  IF NOT it_docno[] IS INITIAL.
  SELECT belnr
         augbl
         augdt
        valut
       pswbt
         wrbtr
         bschl
         INTO TABLE it_bseg
         FROM bseg
         FOR ALL ENTRIES IN it_docno
         WHERE BELNR EQ it_docno-belnr.
  ENDIF.
SORT it_bsis BY belnr.
  SORT it_bseg BY BELNR.
  IF NOT it_bseg[] IS INITIAL.
DELETE IT_BSEG WHERE BSCHL <> 40 AND BSCHL <> 50 OR WRBTR = 0.
    LOOP AT it_bseg.
    READ TABLE it_bsis WITH KEY belnr = it_bseg-BELNR.
      IF IT_BSEG-BSCHL = 25.
      V_AMT = IT_BSEG-WRBTR.
         CONCATENATE V_AMT '-' INTO V_AMT.

HI Veeru,
From your coding i understand that data populated first from BSIS table and then based on those records he post the data and then bsed on those records select data from BSEG table with some conditions. Already u r selecting the data from BSIS(Tble for open items for G/L accounts). Better to give one more condition in where cluase while selecting the data from BSEG as AUGBL EQ ' '.
Hope this help you. Reply for any queries.If not please mention the question clearly.
Regards,
Kumar.

Similar Messages

  • BDC probelm with FBD1

    Hi,
       I am generating BDC for transaction FBD1. How will we develope BDC for different GL codes. Is there any way we can develope BDC for all GL codes. I have no idean on number of GL codes.
      Is there any SAP std program for FBD1 data upload or BAPI.
    Regards,
    Karthik.k

    It would probably be better to use standard SAP program RFBIBL00. It's well documented.
    Rob

  • Probelm in BDC call transaction

    Hi Experts,
    I have a program in which I am calling transaction MI31. This program is having a seelction screen. Now I am facing a problem.
    That is If I am using the statement
    include BDCRECX1
    perform bdc_transaction using 'MI31'.
    This is working fine..I am getting the correct result.But it's showing selection screen of inlcude BDCRECX1.
    But I do not want that screen to display. I always want to execute bdc in MODE N.
    Also I tried with
    CALL TRANSACTION 'MI31' USING BDCDATA
    MODE 'N'.
    But Using this I am not getting the result.
    Is there any way to hide the selction screen of inlcude BDCRECX1 so that I can just pass mode N by default.
    Please help as It's very urgent.
    Helpful answers will be highly rewared.
    Thanks,
    Krishan
    Edited by: Krishan Kumar on Jul 6, 2008 3:32 AM

    Hi,
    Please check the program in the link given below and follow the same procedure.  This should solve your problem.  NO-DISPLAY is the word to be used as given the program.
    Reward points if useful.
    Best Regards,
    Sekhar

  • Problem in the BDC Table Control for the T.Code VA01

    Hi,
      I faced probelm in the BDC of the VA01. In the Table Control
    the records are entered upto 12 line items. after 13th line item overwrites the first record. How to solve the Problem.
    Please help me.

    or use this
    Internal table definition *
    data : begin of bdcdata occurs 0.
            include structure bdcdata.
    data : end of bdcdata.
    data: begin of messtab occurs 0.
            include structure bdcmsgcoll.
    data: end of messtab.
    data: v_chr_opengrp type c,
          r_matnr like mara-matnr,                       "variable for material conversion
          r_werks like marc-werks,                       "variable for plant
          v_str_fname   type string.
    data: begin of count2,
          inrec(9) type n,                               " input I_MATERIAL count
          create(9) type n,                              " create count
          error(9) type n,                               " error count
          bdc(9) type n,                                 " count of BDC creates
          end of count2.
    types: begin of ty_source,
    partn_numb(10) type n ,"Customer Number 1
    ref(035),
    sales_org(4) , "Sales Organization
    distr_chan(2) , "Distribution Channel
    division(002), "DIVISION
    doc_type(4) , "Sales Document Type
    purch_no(020), "Purchase order
    material like vbap-matnr,
    reqqty(018),
    reqdate(010),
    end of ty_source,
    begin of ty_header ,
    partn_numb(10) ,"Customer Number 1
    ref(035),
    sales_org(4) , "Sales Organization
    distr_chan(2) , "Distribution Channel
    division(002), "DIVISION
    doc_type(4) , "Sales Document Type
    purch_no(020), "Purchase order
    end of ty_header,
    begin of ty_item,
    partn_numb(10) ,"Customer Number 1
    ref(035),
    material like vbap-matnr,
    reqqty(018),
    reqdate(010),
    end of ty_item.
    data : msg(240) type c, " Return Message
    e_rec(8) type c, " Error Records Counter
    rec_no(8) type c, " Records Number Indicator
    s_rec(8) type c, " Successful Records Counter
    t_rec(8) type c, " Total Records Counter
    v_matnr like mara-matnr.
    data: val(2) type n value 01.
    data : begin of bdc_itab occurs 0.
            include structure bdcdata.
    data : end of bdc_itab.
    data : t_source type standard table of ty_source   with header line,
    t_header type standard table of ty_header initial size 1,
    t_item type standard table of ty_item initial size 1,
    t_target type standard table of bdcdata initial size 1.
    data : w_source type ty_source,
    w_source1 type ty_source,
    w_header type ty_header,
    w_item type ty_item,
    w_target type bdcdata,
    count type i,
    count1 type n.
    Variable Declaration
    data: w_fname type string,
    fnam(20),
    date1(10),
    i(2) type n,
    v_count type i,
    v_group type apqi-groupid.
    *& selection screen
    selection-screen :begin of block bl1 with frame title  text-001.
    parameters : p_fname type rlgrap-filename,                         "Input file
                 p_update(1) default 'N',                              "Input for update mode
                 p_bdcgrp(12) default 'SD_ORDERS'.                     "Input for session name
    selection-screen end of block bl1.
    **&SELECTION SCREEN VALIDATIONS
    at selection-screen on value-request for p_fname.
      call function 'KD_GET_FILENAME_ON_F4'
        exporting
          program_name  = 'ZMATERIAL'
          dynpro_number = '1000'
          field_name    = 'P_FNAME'
        changing
          file_name     = p_fname.
    *& Start of selection
    start-of-selection.
      if  p_fname is initial.
        message i016(rp) with 'Please enter a file name'.
        leave list-processing.
      else.
        move p_fname to  v_str_fname.
      endif.
      call function 'GUI_UPLOAD'
        exporting
          filetype                = 'ASC'
          filename                = v_str_fname
          has_field_separator     = 'X'
        tables
          data_tab                = t_source
        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.
      sort t_source by ref partn_numb.
      loop at t_source into w_source.
        add 1 to count2-inrec.
        w_source1 = w_source.
       AT NEW PARTN_NUMB.  "10/31 KVB
        at new ref.
          w_header-doc_type = w_source1-doc_type..
          w_header-sales_org = w_source1-sales_org .            "'0001'
          w_header-distr_chan = w_source1-distr_chan.           "'01'
          w_header-division = w_source1-division.               " '01'
          w_header-purch_no = w_source1-purch_no.
          w_header-partn_numb = w_source1-partn_numb.
          w_header-ref = w_source1-ref.
          append w_header to t_header.
        endat.
        w_item-partn_numb = w_source1-partn_numb.
        w_item-material = w_source1-material.
        w_item-reqqty = w_source1-reqqty.
        w_item-ref = w_source1-ref.
        w_item-reqdate = w_source1-reqdate.
        append w_item to t_item.
        clear :w_item,w_header.
      endloop.
      loop at t_header into w_header.
        perform bdc_dynpro      using         'SAPMV45A'                  '0101'       .
        perform bdc_field       using         'BDC_CURSOR'                'VBAK-SPART'.
        perform bdc_field       using         'BDC_OKCODE'                '/00'.
        perform bdc_field       using         'VBAK-AUART'                w_header-doc_type.
        perform bdc_field       using         'VBAK-VKORG'                w_header-sales_org.
        perform bdc_field       using         'VBAK-VTWEG'                w_header-distr_chan.
        perform bdc_field       using         'VBAK-SPART'                w_header-division.
        perform bdc_dynpro      using         'SAPMV45A'                  '4001'     .
        perform bdc_field       using         'BDC_OKCODE'                '/00'.
        perform bdc_field       using         'BDC_CURSOR'               'VBKD-BSTKD'.
        perform bdc_field       using         'VBKD-BSTKD'                w_header-purch_no.
        perform bdc_field       using         'KUWEV-KUNNR'               w_header-partn_numb.
        i = 1.
        loop at t_item into w_item where partn_numb = w_header-partn_numb
                                         and ref = w_header-ref.
          at new partn_numb.
            clear count1.
            count = 0.
          endat.
          count = count + 1.
          if count gt 5.
            clear i.
            i = 2.
            perform bdc_dynpro      using 'SAPMV45A' '4001'      .
            perform bdc_field       using 'BDC_OKCODE' '=POAN'.
          endif.
          count1 = count1 + 1.
          concatenate 'VBAP-POSNR(' i ')' into fnam.
          perform bdc_field       using  fnam
                                        count1.
          concatenate 'RV45A-MABNR(' i ')' into fnam.
          perform bdc_field    using fnam                            w_item-material.
          concatenate 'RV45A-KWMENG(' i ')' into fnam.
          perform bdc_field       using  fnam                        w_item-reqqty..
          concatenate 'RV45A-ETDAT(' i ')' into fnam.
          perform bdc_field       using  fnam                         w_item-reqdate.
          concatenate 'VBKD-BSTKD_E(' i ')' into fnam.
          perform bdc_field       using  fnam                         w_item-ref.
          i = i + 1.
          clear:  w_item.
        endloop.
        clear w_header.
        perform bdc_dynpro      using 'SAPMV45A' '4001'.
        perform bdc_field       using 'BDC_OKCODE'
                                      '=SICH'.
        perform post_transaction.
        refresh bdc_itab.
        clear   bdc_itab.
      endloop.
    *endloop.
    end-of-selection.
      perform finalization.
           Start new screen                                              *
    form bdc_dynpro using program dynpro.
      clear bdc_itab.
      bdc_itab-program  = program.
      bdc_itab-dynpro   = dynpro.
      bdc_itab-dynbegin = 'X'.
      append bdc_itab.
    endform.                    "bdc_dynpro
           Insert field                                                  *
    form bdc_field using fnam fval.
      if fval <> ''.
        clear bdc_itab.
        bdc_itab-fnam = fnam.
        bdc_itab-fval = fval.
        append bdc_itab.
      endif.
    endform.                    "bdc_field
    **&      Form  get_filename
          text
    -->  p1        text
    <--  p2        text
    *form get_filename .
    *call function 'WS_FILENAME_GET'
       exporting
         def_filename     = space
         def_path         = file
         mask             = ',.,..'
         mode             = 'N'
         title            = text-015
       importing
         filename         = file
       exceptions
         inv_winsys       = 1
         no_batch         = 2
         selection_cancel = 3
         selection_error  = 4
         others           = 5.
    *endform.                    " get_filename
    *&      Form  post_transaction
          text
    -->  p1        text
    <--  p2        text
    form post_transaction .
      refresh messtab.
      clear   messtab.
      call transaction  'VA01' using bdc_itab
                  mode   p_update
                update  'S'
              messages into messtab.
      read table messtab with key msgtyp = 'E'.
      if sy-subrc eq 0.
        perform process_error_messages.
        add 1 to count2-bdc.
        if v_chr_opengrp is initial.
          perform bdc_open_group.
        endif.
        call function 'BDC_INSERT'
          exporting
            tcode          = 'VA01'
          tables
            dynprotab      = bdc_itab
          exceptions
            internal_error = 1
            not_open       = 2
            queue_error    = 3
            tcode_invalid  = 4
            others         = 5.
        if sy-subrc <> 0.
          case sy-subrc.
            when 1.
              write: / 'Internal error'.
            when 2.
              write: / 'Not open error'.
            when 3.
              write: / 'queue error'.
            when 4.
              write: / 'tcode invalid error'.
            when others.
              write: / 'other error'.
          endcase.
        endif.
      else.
        add +1 to count2-create.
        format intensified off.
        format color col_normal.
        format color col_normal off.
      endif.
      clear   bdc_itab.
      refresh bdc_itab.
    endform.                    " post_transaction
    *&      Form  finalization
          text
    -->  p1        text
    <--  p2        text
    form finalization .
      if v_chr_opengrp = 'X'.
        call function 'BDC_CLOSE_GROUP'
          exceptions
            not_open    = 1
            queue_error = 2
            others      = 3.
      endif.
      get time.
      skip 2.
      write: / 'Time', sy-uzeit.
      skip.
      format color col_total on.
      write: / 'Total Records: ',           40 count2-inrec.
      write: / 'PERNR not of Emp Group 6 ', 40 count2-error.
      write: / 'Records Created: ',         40 count2-create.
      write: / 'BDC Create in group: ',     40 count2-bdc.
      if v_chr_opengrp = 'X'.
        skip 1.
        format intensified on.
        format color col_negative on.
        write: / 'PLEASE USE TRANSACTION "SM35" ',
                 'TO PROCESS THE GENERATED BDC SESSION ... ',
                 p_bdcgrp.
      endif.
    endform.                    " finalization
    *&      Form  bdc_open_group
          text
    -->  p1        text
    <--  p2        text
    form bdc_open_group .
      call function 'BDC_OPEN_GROUP'
        exporting
          client              = sy-mandt
          group               = p_bdcgrp
          holddate            = sy-datum
          keep                = 'X'
          user                = sy-uname
        exceptions
          client_invalid      = 1
          destination_invalid = 2
          group_invalid       = 3
          group_is_locked     = 4
          holddate_invalid    = 5
          internal_error      = 6
          queue_error         = 7
          running             = 8
          system_lock_error   = 9
          user_invalid        = 10
          others              = 11.
      if sy-subrc eq 0.
        v_chr_opengrp = 'X'.
      endif.
    endform.                    " bdc_open_group
    *&      Form  process_error_messages
          text
    -->  p1        text
    <--  p2        text
    form process_error_messages .
      data: begin of loc_aux_message.
              include structure message.
      data: end of loc_aux_message.
      data : msgno type sy-msgno.
      loop at messtab.
        move messtab-msgnr to msgno.
        call function 'WRITE_MESSAGE'
          exporting
            msgid  = messtab-msgid
            msgno  = msgno
            msgty  = messtab-msgtyp
            msgv1  = messtab-msgv1
            msgv2  = messtab-msgv2
            msgv3  = messtab-msgv3
            msgv4  = messtab-msgv4
          importing
            messg  = loc_aux_message
          exceptions
            others = 1.
        if sy-subrc eq 0.
          format color col_negative on.
          write: /10 loc_aux_message.
          format color col_negative off.
        else.
          format color col_negative on.
          write: /10 t_source-partn_numb.
          write: / 'Error creating message'.
          format color col_negative off.
          exit.
        endif.
      endloop.
    endform.                    " process_error_messages

  • Problem in the BDC program

    Hi Experts,
    I am trying to post data by using transaction FB01. Probelm is , its not posting the data. its not even throughing any error.
    i wrote the program exactly the same of the exiting program in our system which is working. But in my new program BDC is not working. Can any one please help me in this why its not posting.  if you needed any further information please inform me. It is very urgent for me
    Thanks
    Ravi

    Hi Naveen,
    Nice to see your message. I am using the custom bdc report program. In which I am recording all the records from the internal table bdc_data and moving into the function module BDC_INSERT WITH TRANSACTION FB01 AS INPUT and bdc_data as a table input.
    after executing function module sy-subrc is giving 0 with out any exception.
    I am  writing the code below,
    if you need any more information please let me know.
    I am loading the bdc_data table with my internal table data t_data here.
    LOOP AT t_data.
        ADD 1 TO w_recnt.
        IF w_recnt = 1.
          PERFORM generate_email USING '' '' '3A'.
          PERFORM generate_email USING text-m84 '' '3B'.
          PERFORM generate_email USING sy-uline+0(21) '' '3C'.
          PERFORM  dynpro USING:
                   'X' 'SAPMF05A' '100',
                   ' ' 'BKPF-BLDAT' w_bldat,      " Doc date
                   ' ' 'BKPF-BLART' p_blart,      " Doc type
                   ' ' 'BKPF-BUKRS' p_bukrs,      " Company Code
                   ' ' 'BKPF-BUDAT' w_bldat,      " Posting Date
                   ' ' 'BKPF-WAERS' p_waers,      " Currency
                   ' ' 'BKPF-BKTXT' p_bktxt.      " Header Text
      Posting Key Debit = 50 - Credit = 40
          IF t_data-dmbtr <> 0.
            ADD t_data-dmbtr TO w_dmbtr.
            IF t_data-dmbtr > 0.
              PERFORM  dynpro USING: ' ' 'RF05A-NEWBS' '50'.
            ELSE.
              PERFORM  dynpro USING: ' ' 'RF05A-NEWBS' '40'.
            ENDIF.
          ELSE.
            ADD t_data-wrbtr TO w_dmbtr.
            IF t_data-wrbtr > 0.
              PERFORM  dynpro USING: ' ' 'RF05A-NEWBS' '50'.
            ELSE.
              PERFORM  dynpro USING: ' ' 'RF05A-NEWBS' '40'.
            ENDIF.
          ENDIF.
      G/L Account to post to
          PERFORM  dynpro USING: ' ' 'RF05A-NEWKO' t_data-saknr.
          PERFORM  dynpro USING: ' ' 'BDC_OKCODE'  '/00'.
    *---- Assign current values for following loop
          r_data = t_data.
        ELSE.
          CLEAR w_pamnt.
          IF r_data-dmbtr <> 0.
            WRITE r_data-dmbtr TO w_pamnt NO-SIGN NO-GROUPING.
          ELSE.
            WRITE r_data-wrbtr TO w_pamnt NO-SIGN NO-GROUPING.
          ENDIF.
          PERFORM  dynpro USING: 'X' 'SAPMF05A' '300',
                                 ' ' 'BSEG-WRBTR' w_pamnt.
      Contra Posting Key Debit = 40 - Credit =50
          IF t_data-dmbtr <> 0.
            ADD t_data-dmbtr TO w_dmbtr.
            IF t_data-dmbtr > 0.
              PERFORM  dynpro USING: ' ' 'RF05A-NEWBS' '50'.
            ELSE.
              PERFORM  dynpro USING: ' ' 'RF05A-NEWBS' '40'.
            ENDIF.
          ELSE.
            ADD t_data-wrbtr TO w_dmbtr.
            IF t_data-wrbtr > 0.
              PERFORM  dynpro USING: ' ' 'RF05A-NEWBS' '50'.
            ELSE.
              PERFORM  dynpro USING: ' ' 'RF05A-NEWBS' '40'.
            ENDIF.
          ENDIF.
          PERFORM  dynpro USING: ' ' 'RF05A-NEWKO' t_data-saknr.
          PERFORM  dynpro USING: ' ' 'BDC_OKCODE'  '/00'.
      Cost Object Posting
          CASE r_data-objtp.
            WHEN 'CST'.
              PERFORM  dynpro USING: 'X' 'SAPLKACB'   '0002',
                                     ' ' 'COBL-KOSTL' r_data-kostl.
            WHEN 'FND'.
              PERFORM  dynpro USING: 'X' 'SAPLKACB'   '0002',
                                     ' ' 'COBL-GEBER' r_data-kostl.
            WHEN 'WBS'.
              PERFORM  dynpro USING: 'X' 'SAPLKACB'   '0002',
                                     ' ' 'COBL-PS_POSID' r_data-projk.
          ENDCASE.
          PERFORM  dynpro USING: ' ' 'BDC_OKCODE'  '=ENTE'.
          CLEAR r_data.
          r_data = t_data.
        ENDIF.
      ENDLOOP.
    Thanks
    Ravi

  • Info Record BDC

    Hi All
    We have a BDC to upload Material Purchase Price now I have a probelm where in while uploading file system pop-ups two different screens when I reach to condition tab one is create condition xxxx : fast entry and other is FOB Total condition xxxx : condition supplements.
    In our programme we have a loigic where while uploading file system will always have fast entry. Now I do not know in which case system refers to condition supplements screen.
    Regards
    Swara

    I am confused now.
    first you said you havea problem with BDC, now you are saying you have this problem in ME11 and ME12.
    Whats true?

  • How to handle dynamic screens in bdc

    HI SIR,
    i am working on BDC for CA02 in this i have probelm that if operation 10 it doesnot contains any items it showing one  screen and if operation 10 contain some items
    and its item counter increasing automatically in this case it coming to this screen through some other screen.so.plz help me how to handle this dynamic screens in bdc ,plz help.

    hi sir,
              now i am working BDC UPLOAD with tcode CA02 in this in second screen their are some rows like in table control
    opt
    10                x
    20
    30                 x
    like above in this if row one of column contains 'x' then if i want to fill sub item then it display i one screen EX 100 else if it dsplay screen 200(ie item 10 already contains subitems it display  x in one row column(i.e selected check box) else it show unselected check box.plz tell how to know wheather check box is selected or not from screen to .plz tell.
    thanking u

  • Error while running a BDC for the Transaction F-02

    Hi,
           I'm getting an error <b><i>"Parking not possible during Batch Input"</i></b> while running a BDC for the transaction F-02.
           When i click on the error message it displays the message [b<i>]"In Customizing, you can control whether an error message is issued."</b></i>
            How to solve this issue?.
            Waiting for ur replies.........
    Regards
    N.Senthil

    Hi,
    When you are doing the recording in SHDB, and in the same screen where the TCODE to be recorded is given, there are options that you can choose called "Recording Parameters"...Select the checkbox which says "Not a Batch Input Session", this will set the sy-binpt variable to " "(in a recording by default it is "X")...and you will not get this error...
    Also make sure while writing the BDC program to make use of the "bdc options" parameter which has this property to switch of sy-binpt...
        Refer below theard for sample bdc code for f-02.
    https://forums.sdn.sap.com/click.jspa?searchID=5126766&messageID=1538409
    Regards

  • Unable to update the serial number through bdc in Sales Order

    Hi experts,
    I written the inboud FM for to update the 3rd party items serial number to the sales orders through BDC Call transaction Method.
    Here i am facing a problem when i have the 19 item Quan ,it is updating correct through idoc , when ever there is moe than 19 and at that if any serial number repeated for that if i am changing at that time it is loosing the control of the BDC and giving the control to the salesorder screen.
    how can i handle that control again has to come to BDC prgrm......
    Thnks,
    Regards,
    Bharani

    Hi,
    Can you please let me know the segment in ORDERS05 Idoc to process the Payment card information and if the standard Function Module can handle the creation of a Sales Order with data for Payment Card.
    We have a requirement to map the Tokenized Number of the Credit Card send from a store front end to ECC mapping via SAP-PI.
    Thanks in Advance,

  • MULTIPLE ITEM PROBLEM IN VL31N BDC

    hI FRIENDS ,
        I AM POSTING A BDC OF TRANSACTION VL31N ,ie FOR SCHEDULE AGREEMENT INBOUND DELIVERY.I CREATE A FUNCTIONAL MODULE OF THE SAME AND CALL IT FROM AN ASP PAGE,IN THAT THERE IS PO NUMBER 5500000986 WHICH HAS TWO ITEMES 62 AND 95 RESPECTIVLY OF SAME MATARIAL NUMBER R010230123041002 AND DIE NUMBER 2304P,NOW THE PROBLEM IS THIS BDC IS WORKING WHEN THERE IS ONLY ONE ITEM BUT GIVES AN ERROR "CANT CREAT INBOUND DELIVERY FOR PO NO ...' WNEN IT HAS MULTIPLE ITEM.WHAT SHOULD I DO ? I ALSO USED LOOP BUT IT ALSO DOSENT WORK AS IT WILL ADD ALL OPEN QTY OF PO 986 AND UPDATE AGAINST ITEM NO 95.
    CODE IS AS FOLLOWS:.........
    FUNCTION y_synie_bdcinbdly.
    ""Local interface:
    *"  IMPORTING
    *"     VALUE(CTU) LIKE  APQI-PUTACTIVE DEFAULT 'X'
    *"     VALUE(MODE) LIKE  APQI-PUTACTIVE DEFAULT 'N'
    *"     VALUE(UPDATE) LIKE  APQI-PUTACTIVE DEFAULT 'L'
    *"     VALUE(GROUP) LIKE  APQI-GROUPID OPTIONAL
    *"     VALUE(USER) LIKE  APQI-USERID OPTIONAL
    *"     VALUE(KEEP) LIKE  APQI-QERASE OPTIONAL
    *"     VALUE(HOLDDATE) LIKE  APQI-STARTDATE OPTIONAL
    *"     VALUE(NODATA) LIKE  APQI-PUTACTIVE DEFAULT '/'
    *"     VALUE(EXTNID) LIKE  MAKT-MAKTG
    *"     VALUE(VENDORNO) LIKE  LFA1-LIFNR
    *"     VALUE(PONUMBER) LIKE  EKKO-EBELN
    *"     VALUE(ITEMNUMBER) LIKE  LIPS-VGPOS
    *"     VALUE(MATERIAL) LIKE  MAKT-MAKTG
    *"     VALUE(DLYQTY) LIKE  LIPS-LFIMG
    *"     VALUE(BTCHNO) LIKE  LIPS-CHARG
    *"     VALUE(POSLR) LIKE  EKES-EBELP OPTIONAL
    *"  EXPORTING
    *"     VALUE(SUBRC) LIKE  SYST-SUBRC
    *"     VALUE(INDELYNO) LIKE  SY-MSGV2
    *"     VALUE(MSG1) LIKE  SY-MSGV1
    *"     VALUE(MSG2) LIKE  SY-MSGV2
    *"     VALUE(MSG3) LIKE  SY-MSGV3
    *"     VALUE(MSG4) LIKE  SY-MSGV4
    *"  TABLES
    *"      MESSTAB STRUCTURE  BDCMSGCOLL
    *"      ERRTAB STRUCTURE  YSYNERRMSGS
    *"      INDLYTAB STRUCTURE  YSYN_QTYTAB
    Updated by ANAND SYNISE 19.1.2007
      DATA: BEGIN OF bdctab OCCURS 0.
              INCLUDE STRUCTURE bdcdata.
      DATA: END OF bdctab.
      DATA: datenow(10) TYPE c,
            fldvar(30)  TYPE c,
            fldno       TYPE i,
            flditoc(6)  TYPE c,
            qty(13)     TYPE c.
      DATA maxposnr LIKE lips-posnr.
      DATA testposnr TYPE posnr.
      DATA itemnoint TYPE i.
      CONCATENATE sy-datum6(2) '.' sy-datum4(2) '.' sy-datum+0(4) INTO datenow.
      CLEAR bdctab.
      REFRESH bdctab.
      PERFORM open_group      USING group user keep holddate ctu.
           CLEAR bdctab.
           bdctab-program = 'SAPMV50A'.
           bdctab-dynpro = '4007'.
           bdctab-dynbegin = 'X'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_CURSOR'.
           bdctab-fval = 'RV50A-VERUR_LA'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_OKCODE'.
           bdctab-fval = '/00'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'LIKP-LIFNR'.
           bdctab-fval = vendorno.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'LV50C-BSTNR'.
           bdctab-fval = ponumber.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'RV50A-LFDAT_LA'.
           bdctab-fval = datenow.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'RV50A-LFUHR_LA'.
           bdctab-fval = '00:00'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'RV50A-VERUR_LA'.
           bdctab-fval = extnid.
           APPEND bdctab.
       CLEAR bdctab.
           bdctab-program = 'SAPMV50A'.
           bdctab-dynpro = '1000'.
           bdctab-dynbegin = 'X'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_OKCODE'.
           bdctab-fval = '=MKAL_T'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_SUBSCR'.
           bdctab-fval = 'SAPMV50A'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_CURSOR'.
           bdctab-fval = 'LIKP-BLDAT'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'LIKP-BLDAT'.
           bdctab-fval = datenow.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_SUBSCR'.
           bdctab-fval = 'SAPMV50A'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'RV50A-LFDAT_LA'.
           bdctab-fval = datenow.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'RV50A-LFUHR_LA'.
           bdctab-fval = '00:00'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_SUBSCR'.
           bdctab-fval = 'SAPMV50A'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_SUBSCR'.
           bdctab-fval = 'SAPMV50A'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-program = 'SAPMV50A'.
           bdctab-dynpro = '1000'.
           bdctab-dynbegin = 'X'.
           APPEND bdctab.
       CLEAR bdctab.
           bdctab-fnam = 'BDC_OKCODE'.
           bdctab-fval = '=POPO_T'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_SUBSCR'.
           bdctab-fval = 'SAPMV50A'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'LIKP-BLDAT'.
           bdctab-fval = datenow.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_SUBSCR'.
           bdctab-fval = 'SAPMV50A'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_CURSOR'.
           bdctab-fval = 'LIPS-POSNR(01)'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'RV50A-LFDAT_LA'.
           bdctab-fval = datenow.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'RV50A-LFUHR_LA'.
           bdctab-fval = '00:00'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_SUBSCR'.
           bdctab-fval = 'SAPMV50A'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_SUBSCR'.
           bdctab-fval = 'SAPMV50A'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-program = 'SAPMV50A'.
           bdctab-dynpro = '0111'.
           bdctab-dynbegin = 'X'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_CURSOR'.
           bdctab-fval = 'RV50A-PO_MATNR'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_OKCODE'.
           bdctab-fval = 'WEIT'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'RV50A-PO_MATNR'.
           bdctab-fval = material.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-program = 'SAPMV50A'.
           bdctab-dynpro = '1000'.
           bdctab-dynbegin = 'X'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_OKCODE'.
           bdctab-fval = '=POLO_T'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_SUBSCR'.
           bdctab-fval = 'SAPMV50A'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'LIKP-BLDAT'.
           bdctab-fval = datenow.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_SUBSCR'.
           bdctab-fval = 'SAPMV50A'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_CURSOR'.
           bdctab-fval = 'LIPS-POSNR(01)'.
           APPEND bdctab.
    *ADDED BY ANAND ON 22-01-2007
           CLEAR bdctab.
           bdctab-fnam = 'BDC_CURSOR'.
           bdctab-fval =  ITEMNUMBER .     "ITEMNUMBER = LIPS-VGPOS
           APPEND bdctab.
    ************ENDED***********************
    ADDED BY MILIND 19.01.2007
           CLEAR bdctab.
           bdctab-fnam = 'BDC_CURSOR'.
           bdctab-fval =  poslr .
           APPEND bdctab.
    *    ENDED * *
       CLEAR bdctab.
           bdctab-fnam = 'RV50A-LFDAT_LA'.
           bdctab-fval = datenow.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'RV50A-LFUHR_LA'.
           bdctab-fval = '00:00'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'RV50A-LIPS_SELKZ(01)'.
           bdctab-fval = ''.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_SUBSCR'.
           bdctab-fval = 'SAPMV50A'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_SUBSCR'.
           bdctab-fval = 'SAPMV50A'.
           APPEND bdctab.
       CLEAR bdctab.
           bdctab-program = 'SAPMV50A'.
           bdctab-dynpro = '1000'.
           bdctab-dynbegin = 'X'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_OKCODE'.
           bdctab-fval = '/00'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_SUBSCR'.
           bdctab-fval = 'SAPMV50A'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'LIKP-BLDAT'.
           bdctab-fval = datenow.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_SUBSCR'.
           bdctab-fval = 'SAPMV50A'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_CURSOR'.
           bdctab-fval = 'LIPS-CHARG(01)'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'RV50A-LFDAT_LA'.
           bdctab-fval = datenow.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'RV50A-LFUHR_LA'.
           bdctab-fval = '00:00'.
           APPEND bdctab.
           CLEAR bdctab.
          QTY = INDLYTAB-DLYQTY.
            qty = dlyqty.
           bdctab-fnam = 'LIPSD-G_LFIMG(01)'.
           bdctab-fval = QTY.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'LIPS-CHARG(01)'.
    *     BDCTAB-FVAL = INDLYTAB-BTCHNO.
           bdctab-fval = btchno.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_SUBSCR'.
           bdctab-fval = 'SAPMV50A'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_SUBSCR'.
           bdctab-fval = 'SAPMV50A'.
           APPEND bdctab.
       CLEAR bdctab.
           bdctab-program = 'SAPMV50A'.
           bdctab-dynpro = '1000'.
           bdctab-dynbegin = 'X'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_OKCODE'.
           bdctab-fval = '=SICH_T'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_SUBSCR'.
           bdctab-fval = 'SAPMV50A'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'LIKP-BLDAT'.
           bdctab-fval = datenow.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_SUBSCR'.
           bdctab-fval = 'SAPMV50A'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_CURSOR'.
           bdctab-fval = 'LIPS-MATNR(02)'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'RV50A-LFDAT_LA'.
           bdctab-fval = datenow.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'RV50A-LFUHR_LA'.
           bdctab-fval = '00:00'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_SUBSCR'.
           bdctab-fval = 'SAPMV50A'.
           APPEND bdctab.
           CLEAR bdctab.
           bdctab-fnam = 'BDC_SUBSCR'.
           bdctab-fval = 'SAPMV50A'.
           APPEND bdctab.
      CALL TRANSACTION 'VL31N' USING bdctab MODE 'N'  MESSAGES INTO messtab.
      subrc = sy-subrc.
      PERFORM close_group USING     ctu.
      CLEAR bdctab.
      REFRESH bdctab.
      IF sy-subrc EQ 0.
        indelyno = sy-msgv2.
      ENDIF.
      LOOP AT messtab.
        MOVE: messtab-msgid TO errtab-msgid,
              messtab-msgnr TO errtab-msgnr,
              messtab-msgv1 TO errtab-msg1,
              messtab-msgv2 TO errtab-msg2,
              messtab-msgv3 TO errtab-msg3,
              messtab-msgv4 TO errtab-msg4.
        APPEND ERRtab.
      ENDLOOP.
      LOOP AT errtab.
        SELECT SINGLE text FROM t100
          INTO errtab-errmsg
          WHERE msgnr EQ errtab-msgnr AND arbgb EQ errtab-msgid
          AND sprsl EQ sy-langu.
        MODIFY errtab.
      ENDLOOP.
    ENDFUNCTION.

    Hi,
    Check this code:
    REPORT Z_CUSTOMER_UPLOAD .
                  D A T A         D E C L A R A T I O N S                *
    DATA:BEGIN OF IT_CUSTOMER OCCURS 0,
         KUNNR LIKE MV10A-KUNNR,
         VKORG LIKE MV10A-VKORG,
         VTWEG LIKE MV10A-VTWEG,
         MATNR LIKE MV10A-MATNR,
         KDMAT LIKE MV10A-KDMAT,
         MEGRU LIKE MV10A-MEGRU,
         SELKZ TYPE C value 'X',
         LPRIO LIKE MV10A-LPRIO,
         ANTLF LIKE MV10A-ANTLF,
         END OF IT_CUSTOMER.
    DATA:BEGIN OF IT_success OCCURS 0,
         KUNNR LIKE MV10A-KUNNR,
         VKORG LIKE MV10A-VKORG,
         VTWEG LIKE MV10A-VTWEG,
         MATNR LIKE MV10A-MATNR,
         KDMAT LIKE MV10A-KDMAT,
         MEGRU LIKE MV10A-MEGRU,
         SELKZ TYPE C value 'X',
         LPRIO LIKE MV10A-LPRIO,
         ANTLF LIKE MV10A-ANTLF,
         END OF IT_success.
    DATA:BEGIN OF IT_error OCCURS 0,
         KUNNR LIKE MV10A-KUNNR,
         VKORG LIKE MV10A-VKORG,
         VTWEG LIKE MV10A-VTWEG,
         MATNR LIKE MV10A-MATNR,
         KDMAT LIKE MV10A-KDMAT,
         MEGRU LIKE MV10A-MEGRU,
         SELKZ TYPE C value 'X',
         LPRIO LIKE MV10A-LPRIO,
         ANTLF LIKE MV10A-ANTLF,
         END OF IT_error.
    DATA: L_INDEX TYPE SY-TABIX.
    DATA:IT_BDC LIKE BDCDATA OCCURS 0 WITH HEADER LINE,
    IT_DATA TYPE ALSMEX_TABLINE OCCURS 0 WITH HEADER LINE.
    ERROR MESSAGE TABLE
    DATA:IT_MESSAGES LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.
    DATA : C_S TYPE C VALUE 'S',
            C_E TYPE C VALUE 'E'.
    *DATA: IT_SUCCESS LIKE IT_CUSTOMER OCCURS 0,
         IT_ERROR LIKE IT_CUSTOMER  OCCURS 0.
    DATA : V_RECTOT TYPE I,
            V_RECERR TYPE I,
            V_RECSUC TYPE I.
                  S E L E C T I O N  -  S C R E E N                      *
    SELECTION-SCREEN : BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    PARAMETER        : P_FILE LIKE RLGRAP-FILENAME .
    SELECTION-SCREEN : END OF BLOCK B1.
               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.
    to get F4 help for p_file
      PERFORM F4_FILENAME USING P_FILE.
                S T A R T   O F   S E L E C T I O N                      *
    START-OF-SELECTION.
    Uploading data from flat file into it_tab
      PERFORM BDC_UPLOAD USING P_FILE.
      PERFORM PROCESS_DATA.
      PERFORM POPULATE_BDC.
                E N D  O F   S E L E C T I O N                           *
    *END-OF-SELECTION.
    PERFORM DISPLAY_REPORT.
    *&      Form  F4_FILENAME
          text
         -->P_P_FILE  text
    FORM F4_FILENAME USING    P_P_FILE.
    DATA:L_FILE TYPE IBIPPARMS-PATH.
    CALL FUNCTION 'F4_FILENAME'
    EXPORTING
      PROGRAM_NAME        = SYST-CPROG
      DYNPRO_NUMBER       = SYST-DYNNR
      FIELD_NAME          = ' '
    IMPORTING
       FILE_NAME           = L_FILE .
       P_P_FILE = L_FILE.
    ENDFORM.                    " F4_FILENAME
    *&      Form  BDC_UPLOAD
          text
         -->P_P_FILE  text
    FORM BDC_UPLOAD USING    P_P_FILE.
    CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
      EXPORTING
        FILENAME                      = P_P_FILE
        I_BEGIN_COL                   = 1
        I_BEGIN_ROW                   = 1
        I_END_COL                     = 8
        I_END_ROW                     = 1000
      TABLES
        INTERN                        = IT_DATA
    EXCEPTIONS
       INCONSISTENT_PARAMETERS       = 1
       UPLOAD_OLE                    = 2
       OTHERS                        = 3
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDFORM.                    " BDC_UPLOAD
    *&      Form  PROCESS_DATA
          text
    -->  p1        text
    <--  p2        text
    FORM PROCESS_DATA.
    SORT IT_DATA BY ROW COL.
      LOOP AT IT_DATA.
    CASE IT_DATA-COL.
    WHEN 1.
    IT_CUSTOMER-KUNNR   = IT_DATA-VALUE.
    WHEN 2.
    IT_CUSTOMER-VKORG   = IT_DATA-VALUE.
    WHEN 3.
    IT_CUSTOMER-VTWEG   = IT_DATA-VALUE.
    WHEN 4.
    IT_CUSTOMER-MATNR   = IT_DATA-VALUE.
    WHEN 5.
    IT_CUSTOMER-KDMAT   = IT_DATA-VALUE.
    WHEN 6.
    IT_CUSTOMER-MEGRU   = IT_DATA-VALUE.
    WHEN 7.
    IT_CUSTOMER-LPRIO   = IT_DATA-VALUE.
    WHEN 8.
    IT_CUSTOMER-ANTLF   = IT_DATA-VALUE.
    APPEND IT_CUSTOMER.
        ENDCASE.
      ENDLOOP.
    ENDFORM.                    " PROCESS_DATA
    *&      Form  POPULATE_BDC
          text
    -->  p1        text
    <--  p2        text
    FORM POPULATE_BDC.
    DATA:L_COUNTER TYPE N,
             L_STRING TYPE STRING.
    LOOP AT IT_CUSTOMER.
    AT NEW KUNNR.
    CLEAR L_COUNTER.
          L_INDEX = SY-TABIX.
          READ TABLE IT_CUSTOMER INDEX L_INDEX.
    perform bdc_dynpro      using 'SAPMV10A' '0100'.
    perform bdc_field       using 'MV10A-KUNNR'
                                  IT_CUSTOMER-KUNNR.
    perform bdc_field       using 'MV10A-VKORG'
                                  IT_CUSTOMER-VKORG.
    perform bdc_field       using 'MV10A-VTWEG'
                                  IT_CUSTOMER-VTWEG.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    ENDAT.
    L_COUNTER = L_COUNTER + 1.
        CLEAR L_STRING.
    perform bdc_dynpro      using 'SAPMV10A' '0200'.
    CONCATENATE 'MV10A-MATNR(' L_COUNTER ')' INTO L_STRING.
    perform bdc_field       using L_STRING
                            IT_CUSTOMER-MATNR.
    CONCATENATE 'MV10A-KDMAT(' L_COUNTER ')' INTO L_STRING.
    perform bdc_field       using     L_STRING
                                     IT_CUSTOMER-KDMAT.
    CONCATENATE 'MV10A-MEGRU(' L_COUNTER ')' INTO L_STRING.
    perform bdc_field       using   L_STRING
                                    IT_CUSTOMER-MEGRU.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    *-- For Page down in Call Transaction Mode
        IF L_COUNTER = 14.
          CLEAR L_COUNTER.
          PERFORM BDC_DYNPRO      USING 'SAPMV45A' '4001'.
          PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                                '=P+'.
        ENDIF.
    perform bdc_dynpro      using 'SAPMV10A' '0200'.
    CONCATENATE 'MV10A-SELKZ(' L_COUNTER ')' INTO L_STRING.
    perform bdc_field       using L_STRING
                              IT_CUSTOMER-SELKZ.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=SELE'.
    perform bdc_dynpro      using 'SAPMV10A' '0300'.
    perform bdc_field       using 'MV10A-KDMAT'
                                  IT_CUSTOMER-KDMAT.
    perform bdc_field       using 'MV10A-LPRIO'
                                  IT_CUSTOMER-LPRIO.
    perform bdc_field       using 'MV10A-ANTLF'
                                  IT_CUSTOMER-ANTLF.
    PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                        '/EBACK'.
    at end of kunnr.
    READ TABLE IT_CUSTOMER INDEX L_INDEX.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=SICH'.
    CALL TRANSACTION 'VD51' USING IT_BDC MODE 'A' UPDATE 'S'
          MESSAGES INTO IT_MESSAGES.
          CLEAR IT_BDC.
          REFRESH IT_BDC.
    ENDAT.
      IF NOT IT_MESSAGES[] IS INITIAL.
        PERFORM FORMAT_MESSAGE.
      ENDIF.
    ENDLOOP.
    ENDFORM.                    " POPULATE_BDC
    *&      Form  bdc_dynpro
          text
         -->P_0273   text
         -->P_0274   text
    FORM bdc_dynpro USING    VALUE(P_0273)
                             VALUE(P_0274).
    IT_BDC-PROGRAM = P_0273.
    IT_BDC-DYNPRO = P_0274.
    IT_BDC-DYNBEGIN = 'X'.
      APPEND IT_BDC.
      CLEAR IT_BDC.
    ENDFORM.                    " bdc_dynpro
    *&      Form  bdc_field
          text
         -->P_0278   text
         -->P_RECORD_KUNNR_001  text
    FORM bdc_field USING    VALUE(P_0278)
                           VALUE(P_0279).
    IT_BDC-FNAM = P_0278.
      IT_BDC-FVAL = P_0279.
      APPEND IT_BDC.
      CLEAR IT_BDC.
    ENDFORM.                    " bdc_field
    *&      Form  FORMAT_MESSAGE
          text
    -->  p1        text
    <--  p2        text
    FORM FORMAT_MESSAGE.
    DATA: L_MSG(100).
      LOOP AT IT_MESSAGES.
      READ TABLE IT_CUSTOMER INDEX L_INDEX.
        CALL FUNCTION 'FORMAT_MESSAGE'
             EXPORTING
                  ID        = IT_MESSAGES-MSGID
                  LANG      = SY-LANGU
                  NO        = IT_MESSAGES-MSGNR
                  V1        = IT_MESSAGES-MSGV1
                  V2        = IT_MESSAGES-MSGV2
                  V3        = IT_MESSAGES-MSGV3
                  V4        = IT_MESSAGES-MSGV4
             IMPORTING
                  MSG       = L_MSG
             EXCEPTIONS
                  NOT_FOUND = 1
                  OTHERS    = 2.
        IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
        write:/ l_msg.
      ENDLOOP.
    ENDFORM.                    " FORMAT_MESSAGE
    reward if helpful,
    keerthi

  • Creation of PGI using BDC for tc VL02N is not happening..

    Hi All,
    i need to do Post Goods Issue (PGI) thro' BDC and after that i need to update the flag in Ztable.
    its giving Success message and updating the database also.
    but its not issuing the PGI.and further i want to create billing doc.So its compulsory to me to post PGI.
    if i look into the BDCMSGCOLL structure its giving "NO BATCH INPUT DATA FOR SCREEN"? why this is happening?
    please let me know immediately....
    REFRESH: tt_bdcmsgcoll .
      CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
        EXPORTING
          input  = wa_created-document_numb
        IMPORTING
          output = wa_created-document_numb.
      REFRESH tt_bdcdata.
      PERFORM bdc_dynpro      USING text-001 text-002.
      PERFORM bdc_field       USING text-008
                                   text-014.
      PERFORM bdc_field       USING text-009
                                    text-011.
      PERFORM bdc_field       USING text-014
                                    wa_created-document_numb.
      PERFORM bdc_dynpro      USING text-001 text-003.
      PERFORM bdc_field       USING text-009
                                    text-036.
      PERFORM bdc_field       USING text-025
                                    sy-datum.
      PERFORM bdc_field       USING text-008
                                    text-035.
      PERFORM bdc_field       USING text-037
                                    sy-datum.
      PERFORM bdc_field       USING text-038
                                    text-029.
      PERFORM bdc_field       USING text-016
                                    c_x.
      CALL TRANSACTION c_t_del USING tt_bdcdata
                                    MODE c_m
                                    UPDATE c_u
                                    MESSAGES INTO tt_bdcmsgcoll .
      SORT tt_bdcmsgcoll BY msgtyp.
      READ TABLE tt_bdcmsgcoll INTO wa_bdcmsgcoll WITH KEY msgtyp = c_e.
      IF sy-subrc EQ 0.
        LOOP AT tt_bdcmsgcoll INTO wa_bdcmsgcoll WHERE msgtyp = c_e.
          CALL FUNCTION 'FORMAT_MESSAGE'
            EXPORTING
              id        = wa_bdcmsgcoll-msgid
              lang      = text-010
              no        = wa_bdcmsgcoll-msgnr
              v1        = wa_bdcmsgcoll-msgv1
              v2        = wa_bdcmsgcoll-msgv2
              v3        = wa_bdcmsgcoll-msgv3
              v4        = wa_bdcmsgcoll-msgv4
            IMPORTING
              msg       = v_msg
            EXCEPTIONS
              not_found = 1
              OTHERS    = 2.
          IF sy-subrc <> 0.
          ENDIF.
          WRITE :/ v_msg.
        ENDLOOP.
      ELSE.
        MOVE : c_x TO wa_worklist-pgi_flag.
        READ TABLE tt_epit INTO wa_epit WITH KEY epi_id = wa_worklist-epi_id epi_sr = wa_worklist-epi_sr.
        IF sy-subrc EQ  0.
          MODIFY tt_epit FROM wa_worklist TRANSPORTING pgi_flag WHERE epi_id = wa_worklist-epi_id AND epi_sr = wa_worklist-epi_sr.
        ELSE.
          APPEND wa_worklist TO tt_epit.
        ENDIF.
         wa_epit-pgi_flag = c_x.
         MODIFY   tt_epit FROM wa_epit TRANSPORTING pgi_flag WHERE epi_id = wa_worklist-epi_id AND del_no = wa_created-document_numb .
         UPDATE zsd_dt_epit SET pgi_flag = 'X' WHERE epi_id = wa_worklist-epi_id AND del_no = wa_created-document_numb .
         IF  sy-subrc EQ 0.
         ENDIF.
      ENDIF.

    HI,
    Please refer this
    To perform Post goods issue
        PERFORM OPEN_GROUP.
        PERFORM BDC_DYNPRO      USING 'SAPMV50A' '4004'.
        PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                      'LIKP-VBELN'.
        PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                      '=WABU_T'.
        PERFORM BDC_FIELD       USING 'LIKP-VBELN' DELIVERY.
                                 '84000064'.
        PERFORM BDC_TRANSACTION USING 'VL02N'.
        PERFORM CLOSE_GROUP.
        CLEAR : DELIVERY,
                T_BSITEM,
                T_BSICTL.
      ENDIF.
    ENDFORM.                    " DELIVERY

  • Problem in creation of BDC for transaction phap_create

    Hello Friends,
    I am trying to create BDC for PHAP_CREATE.
    When you run a transaction a pop up window appears to select the template id.
    And in BDC it is selected by cursor position. So once selected, the value of template id cannot be changed.
    I want this as a parameter.So that each time I run a BDC I will be able to create different types of Appraisal documents i.e with different template ids.
    How to go about it???
    Regards,
    Bhushan

    Hi,
    For selecting the id, while doing recording,
    record with
    CTRL + F ( Where u can give ur id) and proceed further.

  • Help needed in BDC

    Dear Experts,
    I have a module pool program and transaction for shipping advice, where I have given a option that if user enters Sales Order in the selection screen and in the next screen it shows all the related infromation of that order and if needed user can edit few fields in this screen and can take print.
    Now for the same report I dont want to show any screen to user after user enters the order and executes directly it should display the dialog box for 'Print' and 'Print Preview'.
    I did BDC recording for the transaction of shipping adive report and with that code I have developed other program and if run this program in foreground (Mode "A")it will show all screens with that dialog screen for 'Print' also but if I run in background (Mode "B") it will not show any screen and it will print the document directly.
    Now my requirement is I have to show only dialog screen for 'Print' & 'Print Preview'.
    Please give me your valuable Ideas on how to achieve this...
    Thanks in advance.
    Best Regards
    Venkat

    Hello,
    May be you are not using the full recording or might have some mistake(s) is going on in the completion of recording that is why it is creating problem. And also please check the call transaction code in the BDC program, whether you are performing the accurate t-code with that or not and also perform BDC functions also. If it is right than it would not might have any problem regarding the required output as you want.
    Thanks & Regards,
    Akg

  • What is the Tcodes for Uploading of data using BDC & CATT

    PP members:
    I was going through the <b>cutover activities</b> ,  and what I understood is  we transfer all the legacy system data into SAP before going live
    The data upload follows certain steps (depends on the organizational design load strategies)
    First we upload all the master data ( material master, BOM, W/C's & Routings)
    Then the transaction data ( Ideally speaking, there should no open orders i.e. WIP as on the day of cutoff )
    If the WIP (Work in Process) is unavoidable then the materials consumed shall be treated as <b>materials of the previous stage</b> and necessary adjustments shall be made after cutover day
    At this point, I could not able to understand what does the author mean <b>materials of the previous stage</b>
    Now comming to the uploading of data into SAP from legacy system, we use tools like LSMW, CATT & BDC
    Is it a must to use <b>only LSMW tool</b> to upload master data or any other upload tools are fine
    Lastly,. I am not sure about the Tcode of CATT & BDC
    Summary of the questions:
    1.What does the author mean  <b>material of previous stage</b>, for WIP materials during cutover activities
    2. Is it mandatory to use only LSMW tool for uploading for master data
    3. What are the Tcodes for upload tools CATT & BDC ?
    Thanks for your time
    Suren R

    Dear,
    1.What does the author mean material of previous stage, for WIP materials during cutover activities - as i understood, what is the stage of material..like it must have gone through 2 work centers and other 2 is left. i.e. you need to create Production order with only 2 operation as other 2 is already over. - usually it is done in such a way that we will create Production order and confirm till 2 operations and WIp is calculated so thatb FI will tally the books in SAP and lagacy.
    2. Is it mandatory to use only LSMW tool for uploading for master data - no you can use any tool as required and suits yr requirement
    3. What are the Tcodes for upload tools CATT & BDC- BDC through a prog in SE38. CATT through - SCEM.

  • Unable to capture sy-ucomm in BDC

         Hello Everyone, 
    I have created a BDC for CG3Y everything is working fine after creating a log when sy-subrc eq 0. when user hits SAVE I have given a message stating 'LOG HAS BEEN GENERATED' but when the pop for overwrite appears and I hit NO, it should give a different message for that i am not able to capture SY-UCOMM.
    please help.

    Actually the issue was just had to get the file(Error log) from Application Server to Presentation, Here is the code for it.
    data: i_fl_openerror type boolean,
    i_os_message(100) type C,
    i_flg_continue type boolean.
    CALL FUNCTION 'C13Z_FILE_DOWNLOAD_ASCII'
    EXPORTING
    i_file_front_end          = 'C:\ERROR_LOG.XLS'
    i_file_appl               = '/USR/SAP/TMP/FILE3.XLS'
    *   I_FILE_OVERWRITE          = ESP1_FALSE
    IMPORTING
    E_FLG_OPEN_ERROR          = i_fl_openerror
    E_OS_MESSAGE              = i_os_message
    EXCEPTIONS
    FE_FILE_OPEN_ERROR        = 1
    FE_FILE_EXISTS            = 2
    FE_FILE_WRITE_ERROR       = 3
    AP_NO_AUTHORITY           = 4
    AP_FILE_OPEN_ERROR        = 5
    AP_FILE_EMPTY             = 6
    OTHERS                    = 7
    IF sy-subrc <> 0.
    case sy-subrc.
    when 2.
    CALL FUNCTION 'C14A_POPUP_ASK_FILE_OVERWRITE'
    IMPORTING
    E_FLG_CONTINUE       = i_flg_continue
    if i_flg_continue eq true.
    CALL FUNCTION 'C13Z_FILE_DOWNLOAD_ASCII'
    EXPORTING
    i_file_front_end          = 'C:\ERROR_LOG.XLS'
    i_file_appl               = '/USR/SAP/TMP/FILE3.XLS'
    I_FILE_OVERWRITE          = ESP1_TRUE
    IMPORTING
    E_FLG_OPEN_ERROR          = i_fl_openerror
    E_OS_MESSAGE              = i_os_message
    EXCEPTIONS
    FE_FILE_OPEN_ERROR        = 1
    FE_FILE_EXISTS            = 2
    FE_FILE_WRITE_ERROR       = 3
    AP_NO_AUTHORITY           = 4
    AP_FILE_OPEN_ERROR        = 5
    AP_FILE_EMPTY             = 6
    OTHERS                    = 7
    IF sy-subrc <> 0.
    write : / 'CANNOT DOWNLOAD' , '/USR/SAP/TMP/FILE3.XLS' .
    else.
    write : / 'LOG HAS BEEN GENERATED C:\ERROR_LOG.XLS'.
    endif.
    else.
    write : / 'LOG NOT GENERATED'.
    endif.
    when others .
    write : / 'CANNOT DOWNLOAD FILE1', '/USR/SAP/TMP/FILE3.XLS'.
    endcase.

Maybe you are looking for