QM- Bdc Problem
hi
experts iam doing a bdc for change in qp02 ..inspection plan
here i got a problem in this tcode i will enter
matnr,werks,group, then i have to select the group counter and click the opeartion push button .i will get multiple characterstic i have to select one among them and goto inspection characterstic and again there are multiple charctersic and there among those one or
two had to be changed .
The problem is when i enter to first screen ..i wil get grpc ,werks and usage that is from flat file ..but if there any multiple suppose1,2,3, but in file there is only 2 or 2 and 3 then iam not getting the logic to select 2 or 3 and got to operations .in operation for
that material had aslo same problem mutiple operation how to select the particular operation number from file and goto characterstic.
will be helpfull .
if provide logic and example code .
regards
REPORT zqmb_qp02.
DATA: bdcdata LIKE bdcdata OCCURS 0 WITH HEADER LINE.
DATA: BEGIN OF itab OCCURS 0,
* test,
matnr TYPE rc27m-matnr,
werks TYPE rc27m-werks,
sttag TYPE rc271-sttag,
verwe TYPE plkod-verwe,
statu TYPE plkod-statu,
arbpl TYPE plpod-arbpl,
steus TYPE plpod-steus,
ltxa1 TYPE plpod-ltxa1,
END OF itab.
DATA: lv_count(2) TYPE c VALUE 01.
DATA: lv_data(20).
DATA: BEGIN OF i_itab OCCURS 0,
* test,
lv_formula,
matnr TYPE rc27m-matnr,
werks TYPE rc27m-werks,
sttag(10),
verwe TYPE plkod-verwe,
statu TYPE plkod-statu,
arbpl TYPE plpod-arbpl,
steus TYPE plpod-steus,
ltxa1 TYPE plpod-ltxa1,
verwmerkm TYPE plmkb-verwmerkm,
kurztext TYPE plmkb-kurztext,
pmethode TYPE plmkb-pmethode,
stichprver TYPE plmkb-stichprver,
formel1(60)," TYPE plmkb-formel1,
END OF i_itab.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text_001.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(20) text_1_1.
PARAMETERS: p_file LIKE rlgrap-filename OBLIGATORY.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK b1.
INITIALIZATION.
text_001 = 'File path selection'.
text_1_1 = 'File Path'.
* At Selection Screen Event
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
CALL FUNCTION 'F4_FILENAME'
IMPORTING
file_name = p_file.
START-OF-SELECTION.
PERFORM data_upload.
IF i_itab[] IS NOT INITIAL.
PERFORM open_group.
REFRESH bdcdata.
PERFORM bdcdata.
PERFORM close_group.
ENDIF.
*& Form DATA_UPLOAD
* text
* --> p1 text
* <-- p2 text
FORM data_upload.
DATA: loc_filename TYPE string.
loc_filename = p_file.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = loc_filename
filetype = 'ASC'
has_field_separator = 'X'
TABLES
data_tab = i_itab
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. " DATA_UPLOAD
* Start new screen *
FORM bdc_dynpro USING program dynpro.
CLEAR bdcdata.
bdcdata-program = program.
bdcdata-dynpro = dynpro.
bdcdata-dynbegin = 'X'.
APPEND bdcdata.
ENDFORM. "BDC_DYNPRO
* Insert field *
FORM bdc_field USING fnam fval.
CLEAR bdcdata.
bdcdata-fnam = fnam.
bdcdata-fval = fval.
APPEND bdcdata.
ENDFORM. "BDC_FIELD
*& Form OPEN_GROUP
* text
* --> p1 text
* <-- p2 text
FORM open_group .
CALL FUNCTION 'BDC_OPEN_GROUP'
EXPORTING
client = sy-mandt
group = 'QP01'
user = sy-uname
keep = 'X'.
ENDFORM. " OPEN_GROUP
*& Form CLOSE_GROUP
* text
* --> p1 text
* <-- p2 text
FORM close_group .
CALL FUNCTION 'BDC_CLOSE_GROUP'.
CALL TRANSACTION 'SM35'.
ENDFORM. " CLOSE_GROUP
*& Form bdcdata
* text
* --> p1 text
* <-- p2 text
FORM bdcdata .
LOOP AT i_itab.
itab-matnr = i_itab-matnr.
itab-werks = i_itab-werks.
itab-sttag = i_itab-sttag.
itab-verwe = i_itab-verwe.
itab-statu = i_itab-statu.
itab-arbpl = i_itab-arbpl.
itab-steus = i_itab-steus.
itab-ltxa1 = i_itab-ltxa1.
APPEND itab.
CLEAR itab.
ENDLOOP.
DELETE ADJACENT DUPLICATES FROM itab.
CLEAR itab.
*---->>> Insert Recording Here
LOOP AT itab.
REFRESH bdcdata.
PERFORM bdc_dynpro USING 'SAPLCPDI' '8010'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RC27M-MATNR'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'RC27M-MATNR'
itab-matnr.
* 'RAWMMMMMMMMMMMMMMM'.
PERFORM bdc_field USING 'RC27M-WERKS'
itab-werks.
* '2010'.
PERFORM bdc_field USING 'RC271-STTAG'
itab-sttag.
* '06.09.2008'.
PERFORM bdc_dynpro USING 'SAPLCPDA' '1200'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
* PERFORM bdc_field USING 'PLKOD-PLNAL'
* itab-plnal.
** '1'.
* PERFORM bdc_field USING 'PLKOD-KTEXT'
* itab-ktext.
* 'Printing and Stationary'.
*perform bdc_field using 'PLKOD-WERKS'
* '2010'.
PERFORM bdc_field USING 'BDC_CURSOR'
'PLKOD-STATU'.
PERFORM bdc_field USING 'PLKOD-VERWE'
itab-verwe.
* '5'.
PERFORM bdc_field USING 'PLKOD-STATU'
itab-statu.
* '4'.
*perform bdc_field using 'PLKOD-LOSBS'
* '99,999,999'.
*perform bdc_field using 'PLKOD-PLNME'
* 'EA'.
PERFORM bdc_dynpro USING 'SAPLCPDA' '1200'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=VOUE'.
* PERFORM bdc_field USING 'PLKOD-KTEXT'
* 'Printing and Stationary'.
* PERFORM bdc_field USING 'PLKOD-WERKS'
* '2010'.
PERFORM bdc_field USING 'BDC_CURSOR'
'PLKOD-STATU'.
* PERFORM bdc_field USING 'PLKOD-VERWE'
* '5'.
* PERFORM bdc_field USING 'PLKOD-STATU'
* '4'.
* PERFORM bdc_field USING 'PLKOD-LOSBS'
* '99,999,999'.
* PERFORM bdc_field USING 'PLKOD-PLNME'
* 'EA'.
PERFORM bdc_dynpro USING 'SAPLCPDI' '1400'.
PERFORM bdc_field USING 'BDC_CURSOR'
'PLPOD-LTXA1(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'PLPOD-ARBPL(01)'
itab-arbpl.
* 'qclab'.
PERFORM bdc_field USING 'PLPOD-STEUS(01)'
itab-steus.
* 'qm01'.
PERFORM bdc_field USING 'PLPOD-LTXA1(01)'
itab-ltxa1.
* 'TESTING'.
PERFORM bdc_dynpro USING 'SAPLCPDI' '1400'.
PERFORM bdc_field USING 'BDC_CURSOR'
'PLPOD-VORNR(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=QMUE'.
PERFORM bdc_field USING 'RC27X-ENTRY_ACT'
'1'.
PERFORM bdc_field USING 'RC27X-FLG_SEL(01)'
'X'.
LOOP AT i_itab WHERE matnr = itab-matnr
AND werks = itab-werks
AND steus = itab-steus "CONTROL KEY
AND ltxa1 = itab-ltxa1. "DESCRIPTION
PERFORM bdc_dynpro USING 'SAPLQPAA' '0150'.
CONCATENATE 'PLMKB-STICHPRVER(' lv_count ')' INTO lv_data.
PERFORM bdc_field USING 'BDC_CURSOR'
lv_data.
* 'PLMKB-STICHPRVER(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
CONCATENATE 'PLMKB-VERWMERKM(' lv_count ')' INTO lv_data.
PERFORM bdc_field USING lv_data
i_itab-verwmerkm.
* 'flange'.
CONCATENATE 'PLMKB-KURZTEXT(' lv_count ')' INTO lv_data.
PERFORM bdc_field USING lv_data
i_itab-kurztext.
* 'FLANGE CUSTOMER MOUNTING SEAT DIA'.
CONCATENATE 'PLMKB-PMETHODE(' lv_count ')' INTO lv_data.
PERFORM bdc_field USING lv_data
i_itab-pmethode.
* '10000000'.
CONCATENATE 'PLMKB-STICHPRVER(' lv_count ')' INTO lv_data.
PERFORM bdc_field USING lv_data
i_itab-stichprver.
* 'FIXED-1'.
PERFORM bdc_dynpro USING 'SAPLQPAA' '1501'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENT1'.
PERFORM bdc_field USING 'BDC_CURSOR'
'PLMKB-VERWMERKM'.
PERFORM bdc_field USING 'PLMKB-VERWMERKM'
i_itab-verwmerkm.
* 'FLANGE'.
PERFORM bdc_field USING 'PLMKB-QPMK_WERKS'
i_itab-werks.
* '2010'.
PERFORM bdc_field USING 'PLMKB-PMETHODE'
i_itab-pmethode.
* '10000000'.
PERFORM bdc_field USING 'PLMKB-QMTB_WERKS'
i_itab-werks.
* '2010'.
PERFORM bdc_dynpro USING 'SAPLQPAA' '1502'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENT1'.
PERFORM bdc_field USING 'BDC_CURSOR'
'PLMKB-PMETHODE'.
PERFORM bdc_field USING 'PLMKB-PMETHODE'
i_itab-pmethode.
* '10000000'.
PERFORM bdc_field USING 'PLMKB-QMTB_WERKS'
i_itab-werks.
* '2010'.
PERFORM bdc_dynpro USING 'SAPLQPAA' '1502'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENT1'.
PERFORM bdc_field USING 'BDC_CURSOR'
'PLMKB-PMETHODE'.
PERFORM bdc_field USING 'PLMKB-PMETHODE'
i_itab-pmethode.
* '10000000'.
PERFORM bdc_field USING 'PLMKB-QMTB_WERKS'
i_itab-werks.
* '2010'.
IF i_itab-lv_formula IS NOT INITIAL.
PERFORM bdc_dynpro USING 'SAPLQPAA' '1522'.
PERFORM bdc_field USING 'BDC_CURSOR'
'PLMKB-FORMEL1'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENT1'.
PERFORM bdc_field USING 'PLMKB-FORMELSL'
'X'.
PERFORM bdc_field USING 'PLMKB-FORMEL1'
i_itab-formel1.
* 'c010'.
ENDIF.
lv_count = lv_count + 1.
ENDLOOP.
lv_count = 01.
PERFORM bdc_dynpro USING 'SAPLQPAA' '0150'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RQPAS-ENTRY_ACT'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=QMBU'.
PERFORM bdc_field USING 'RQPAS-ENTRY_ACT'
'1'.
* ENDLOOP.
PERFORM bdc_insert.
ENDLOOP.
ENDFORM. " bdcdata
*& Form bdc_insert
* text
* --> p1 text
* <-- p2 text
FORM bdc_insert.
CALL FUNCTION 'BDC_INSERT'
EXPORTING
tcode = 'QP01'
TABLES
dynprotab = bdcdata.
ENDFORM. " bdc_insert
Edited by: PRAKASH VARUN on Apr 18, 2009 1:36 PM
Similar Messages
-
Hi All,
I want to record a BDC for F-30 to clear the deduction line items for a Document. These deduction line items have a "Reason code" with it... When I select a Document Number in F-30, it displays all the line items in a table control.. I need to select and clear only those items with "Reason code" in that...
How can I select a line item from the table control and clear it based on the reason code in a BDC?
I have looked at the previous posts... I have seen a solution provided by filling the structure BSELP. How this can be included in the program and how to fill the values... Is there any limit for the values to get it filled?.. Because I could see
FELDN_1 to FELDN_18 in BSELP structure.....
BDC problem in F-30
BSELP-FELDN_1 = "BELNR"
BSELP-SLVON_1 = "00002222221997003"
How the rfbibl00 program works?
Thanks for the help,
AshaHi,
Use BAPI_PAYIT_POST_CLEARING
or FM POSTING_INTERFACE_CLEARING
or
try this code for transaction fb05:
DATA: BEGIN OF bkey OCCURS 0,
belnr LIKE bseg-belnr,
gjahr LIKE bseg-gjahr,
buzei LIKE bseg-buzei,
END OF bkey.
*Dynpro 122 - Header
PERFORM bdc_dynpro USING 'SAPMF05A' '0122'.
PERFORM bdc_field USING 'BKPF-BLDAT' agz-datum.
PERFORM bdc_field USING 'BKPF-BLART' augblart.
PERFORM bdc_field USING 'BKPF-BUKRS' htab-bukrs.
PERFORM bdc_field USING 'BKPF-BUDAT' agz-datum.
PERFORM bdc_field USING 'BKPF-WAERS' t001-waers.
IF t003-xmref = 'X'.
IF htab-xblnr <> space.
PERFORM bdc_field USING 'BKPF-XBLNR' htab-xblnr.
ELSE.
PERFORM bdc_field USING 'BKPF-XBLNR' text-aag.
ENDIF.
ENDIF.
UNPACK vorgang TO zeile.
PERFORM bdc_field_loop USING zeile 'RF05A-XPOS1' 'X'.
PERFORM bdc_field USING 'BDC_OKCODE' 'SL'.
LOOP AT itab WHERE marked = 'X'.
*Dynpro 0710 -
PERFORM bdc_dynpro USING 'SAPMF05A' '0710'.
PERFORM bdc_field USING 'RF05A-AGKON' agku-kunnr.
PERFORM bdc_field USING 'RF05A-AGBUK' agku-bukrs.
PERFORM bdc_field USING 'BDC_OKCODE' 'SLB'. "ins
*Dynpro 0733 - insert fi-document-nr.
PERFORM bdc_dynpro USING 'SAPMF05A' '0733'.
CLEAR: zeile, cnt.
LOOP AT htab WHERE agzif = agc-nr AND xfeld = 'X'
AND bukrs = agku-bukrs AND kunnr = agku-kunnr.
CLEAR bkey.
cnt = cnt + 1.
UNPACK cnt TO zeile.
PERFORM bdc_field_loop USING zeile 'RF05A-FELDN' 'BELNR'.
MOVE-CORRESPONDING tab TO bkey.
PERFORM bdc_field_loop USING zeile 'RF05A-SEL01' bkey.
ENDLOOP.
<b>Reward points</b>
Regards -
BDC Problem : Tcode : F-30
Hi All,
BDC Problem :
Iam working with Tcode : F-30.
Iam able to post the the document in All (A) screen mode
But Iam unable to post the document in No (N) screen mode
Please let me know how to solve this issue
Thanks
SunilHI,
R u getting any errors while creating using 'A'.
If not then use commit work after BDC.
Thanks -
Change transaction using BDC-problem for large number of lines on screen
Hi All,
I am developing BAPI (using BDC) which creates quality notification in SAP which is entered via front end web application. Structure p_qmsm contain 3 lines of task in notification. The code is as given below. To avoid problem of large no of lines on screen,code lines starting with * is used. This actually for pagedown after entering every 2 lines and creates new line. so that 2 lines always push up on screen and there will not be problem for creating large no of lines on screen
perform bdc_dynpro using 'SAPLIQS0' '7200'.
perform bdc_field using 'BDC_OKCODE' '=10\TAB11'.
LOOP AT p_qmsm INTO wa_qmsm.
*IF wa_qmsm_cntr > 2.
wa_qmsm_cntr = 2.
perform bdc_dynpro using 'SAPLIQS0' '7204'.
perform bdc_field using 'BDC_OKCODE' '=PEND'.
ENDIF.
perform bdc_dynpro using 'SAPLIQS0' '7204'.
perform bdc_field using 'BDC_OKCODE' '/00'.
CONCATENATE 'VIQMSM-QSMNUM(' wa_qmsm_cntr ')' INTO wm_qmsm_qsmnum.
CONCATENATE 'VIQMSM-MNGRP(' wa_qmsm_cntr ')' INTO wm_qmsm_mngrp.
CONCATENATE 'VIQMSM-MNCOD(' wa_qmsm_cntr ')' INTO wm_qmsm_mncod.
CONCATENATE 'VIQMSM-MATXT(' wa_qmsm_cntr ')' INTO wm_qmsm_matxt.
perform bdc_field using wm_qmsm_qsmnum wa_qmsm-qsmnum.
perform bdc_field using wm_qmsm_mngrp wa_qmsm-mngrp.
perform bdc_field using wm_qmsm_mncod wa_qmsm-mncod.
perform bdc_field using wm_qmsm_matxt wa_qmsm-matxt.
wa_qmsm_cntr = wa_qmsm_cntr + 01.
ENDLOOP.
CALL TRANSACTION 'IQS2' USING wt_bdc
MODE 'N' UPDATE 'A' MESSAGES INTO P_MESSTAB.
The same code is used in modify mode also. web application is sending all 3 lines in modify mode even if single line is modified. It is already decided to send all rows back from web application to SAP in same sequence. It is working fine if i comment 5 lines which is starting with *. But in modify mode, how can i ensure that correct row is modified? and how can i achieve problem of large no of lines on screen?Please suggest?Hi yogesh,
how can i ensure that correct row is modified?
1. For this we need to know two things ;
a) the database table in which the entries are already stored
b) the sequence in which they are displayed in the transaction.
2. So before changing any line, we need to compare (the primary key values / important values)
a) as per the database table and as per the incoming data from web application (using bapi)
b) if the match is ok, it means that particular row was not modified, else modified.
how can i achieve problem of large no of lines on screen?
1. For this I am not sure about the transaction and its screen. Manytimes for appending row on the screen,
there is a PLUS + button on the grid toolbar. So for every entry, (inspite of some empty/filled rows already visible on the screen), we should use the + button, and this new row always appears on the top i.e. row number 1.
hope this helps.
regards,
amit m. -
Hi
BDC with mode 'A' is working correctly but when I make the mode 'N' it gives a dump.
With mode 'A' the record is updated , what may be the cause?
ThanksI am using the tcode 7kE1 for bdc , it works perfectly with mode 'A' , but not with mode 'N', It give error 'Message_Type_Unknown' .
there is no problem with the file as values are going correctly in tcode
Edited by: Puneeta Parnami on Jun 12, 2009 12:57 PM -
Hi All,
I am following the below procedure to populate the transaction F-32 using BDC but I have a small doubt:
1) I go to F-32 Transaction code populate the required fields on that and press F5
2) It takes to second screen which has three fields as Field in which I am populating BELNR, second field is Lower Limit field which has a value combination of year document type document number, third field is left blank.
Now I need to Clear Only part of the second field say for example year part.
How can I do that? Has anyone faced this kind of problem if so Please reply back.
Thanks & Regards,
Joseph Reddy.
Message was edited by: Joseph Reddy YeruvaHi Rob,
This is how the code is written
PERFORM bdc_dynpro USING 'SAPMF05A' '0131'.
PERFORM bdc_field USING:
'BDC_CURSOR' 'BKPF-WAERS',
'BDC_OKCODE' '=SLB',
'RF05A-AGKON' p_kunnr,
'BKPF-BUDAT' lv_date,
'BKPF-MONAT' '11',
'BKPF-BUKRS' p_bukrs,
'BKPF-WAERS' gv_waers.
'RF05A-XNOPS' c_x.
perform bdc_dynpro using 'SAPMF05A' '0733'.
perform bdc_field using 'BDC_CURSOR' 'RF05A- SEL01(01)'.
perform bdc_field using 'BDC_OKCODE'
'=PA'.
perform bdc_field using 'RF05A-FELDN(01)'
'BELNR'.
perform bdc_field using 'RF05A-FELDN(02)'
record-FELDN_02_008.
perform bdc_field using 'RF05A-FELDN(03)'
record-FELDN_03_009.
perform bdc_field using 'RF05A-FELDN(04)'
record-FELDN_04_010.
perform bdc_field using 'RF05A-SEL01(01)'
lv_belnr.
perform bdc_field using 'RF05A-SEL01(02)'
record-SEL01_02_012.
perform bdc_field using 'RF05A-SEL01(03)'
record-SEL01_03_013.
perform bdc_field using 'RF05A-SEL01(04)'
record-SEL01_04_014.
perform bdc_dynpro using 'SAPDF05X' '3100'.
perform bdc_field using 'BDC_OKCODE'
'=OMX'.
perform bdc_field using 'BDC_CURSOR'
'DF05B-PSSKT(01)'.
perform bdc_field using 'RF05A-ABPOS'
'001'.
perform bdc_dynpro using 'SAPDF05X' '3100'.
perform bdc_field using 'BDC_OKCODE'
'=Z+'.
perform bdc_field using 'BDC_CURSOR'
'DF05B-PSSKT(01)'.
perform bdc_field using 'RF05A-ABPOS'
'001'.
perform bdc_dynpro using 'SAPDF05X' '3100'.
perform bdc_field using 'BDC_OKCODE'
'=BU'.
perform bdc_field using 'BDC_CURSOR'
'DF05B-PSSKT(01)'.
perform bdc_field using 'RF05A-ABPOS'
'001'.
CALL TRANSACTION 'F-32' USING gt_BDCDATA
MODE 'A' "gv_mode
UPDATE gv_updat.
Rgds,
Joseph -
HI
FRIENDS STUCK IN A SMALL PROBLEM IAM DOING A BDC FOR F-04
IN WHICH I HAD FLAT FILE IN THE FOLLOWING FORMAT ,
27.10.2004 sa npil 31.07.2006 3689525.64 1000 2000 2810200 7400007174
7400007175
7400007176
27.10.2004 sa npil 31.07.2006 3689525.64 1001 2000 2810200 7400007177
7400007178
7400007179
THE DATA IS SPLIT DEPENDING UPON BUSINESS AREA 1000 AND 1001 , BUT IAM NOT ABLE TO GET ALL THE
ACCOUNT NOS STARTING FROM 7400 .. TO NEXT BUSINESS AREA I AM GETTING ONLY THE FIRST ACCT NO.
HERE I THINK AT NEW IS NOT WORKING .
SO PLS CAN ANYBODY TELL ME HOW TO DO THIS .This is the code ,
LOOP AT i_final .
CLEAR i_gsber.
MOVE-CORRESPONDING i_final TO i_gsber.
APPEND i_gsber.
ENDLOOP.
LOOP AT i_gsber.
CLEAR item.
MOVE-CORRESPONDING i_gsber TO item.
IF i_gsber-gsber <> space .
w_gsber = i_gsber-gsber.
ENDIF.
item-gsber = w_gsber.
item-sel01 = i_gsber-sel01.
APPEND item.
ENDLOOP.
*********************the include part
PERFORM bdc_dynpro USING 'SAPMF05A' '0731'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
LOOP AT item WHERE gsber = wa_itab-gsber.
MOVE-CORRESPONDING item TO wa_item.
ENDAT.
LOOP AT item WHERE gsber = i_gsber-gsber.
w_count = w_count + 1.
CONCATENATE 'RF05A-SEL01(' w_count ')' INTO w_bdc.
PERFORM bdc_field USING w_bdc
wa_item-sel01.
IF w_count >= 16.
w_count = 0.
PERFORM bdc_dynpro USING 'SAPMF05A' '0731'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
ENDIF.
ENDLOOP.
AT END OF gsber.
PERFORM bdc_dynpro USING 'SAPMF05A' '0731'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=PA'.
PERFORM bdc_dynpro USING 'SAPDF05X' '3100'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=AB'.
PERFORM bdc_dynpro USING 'SAPMF05A' '0700'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=BU'.
regards -
URGENT: BDC problem small one
hi everybody
I am new to BDC and I have created a BDC for MM01. It is working well. I am using it by call transaction method. But my problem is this when the last material is created it is good but it does not stop and starts the next material creation and every time when i run the bdc it will waste a material number.
and please tell me the code to stop the bdc in each method and to move to next method
follwoing is the bdc code.
report ZDEMO_ZCON
no standard page heading line-size 255.
data: begin of record OCCURS 0,
MATNR(018),
MBRSH_001(001),
MTART_002(004),
WERKS_015(004),
MAKTX(040),
MEINS(003),
MATKL(009),
BISMT(18),
EXTWG(18),
EKGRP(003),
XCHPF_025(001),
WEBAZ(003),
DISGR(004),
DISMM_030(002),
MINBE(18),
DISPO(003),
DISLS(002),
MABST(18),
SOBSL(2),
PLIFZ_034(003),
FHORI_036(003),
MTVFP_039(002),
BKLAS(004),
END OF RECORD.
include bdcrecx1.
start-of-selection.
CALL FUNCTION 'UPLOAD'
EXPORTING
CODEPAGE = ' '
FILENAME = 'C:\BOOKS3' " Name of the tab delimited flat file on desktop
FILETYPE = 'DAT'
ITEM = ' '
FILEMASK_MASK = ' '
FILEMASK_TEXT = ' '
FILETYPE_NO_CHANGE = ' '
FILEMASK_ALL = ' '
FILETYPE_NO_SHOW = ' '
LINE_EXIT = ' '
USER_FORM = ' '
USER_PROG = ' '
SILENT = 'S'
IMPORTING
FILESIZE =
CANCEL =
ACT_FILENAME =
ACT_FILETYPE =
TABLES
data_tab = record " Name of internal table with data.
EXCEPTIONS
CONVERSION_ERROR = 1
INVALID_TABLE_WIDTH = 2
INVALID_TYPE = 3
NO_BATCH = 4
UNKNOWN_ERROR = 5
GUI_REFUSE_FILETRANSFER = 6
OTHERS = 7*
.IF sy-subrc <> 0.
*MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
*ENDIF.
perform open_group.
LOOP AT RECORD.
perform bdc_dynpro using 'SAPLMGMM' '0060'.
perform bdc_field using 'BDC_CURSOR'
'RMMG1-MATNR'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'RMMG1-MBRSH'
'M'.
perform bdc_field using 'RMMG1-MTART'
'ZCON'.
perform bdc_dynpro using 'SAPLMGMM' '0070'.
perform bdc_field using 'BDC_CURSOR'
'MSICHTAUSW-DYTXT(13)'.
perform bdc_field using 'BDC_OKCODE'
'=P+'.
perform bdc_field using 'MSICHTAUSW-KZSEL(01)'
'X'.
perform bdc_field using 'MSICHTAUSW-KZSEL(09)'
'X'.
perform bdc_field using 'MSICHTAUSW-KZSEL(12)'
'X'.
perform bdc_field using 'MSICHTAUSW-KZSEL(13)'
'X'.
perform bdc_dynpro using 'SAPLMGMM' '0070'.
perform bdc_field using 'BDC_CURSOR'
'MSICHTAUSW-DYTXT(08)'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_field using 'MSICHTAUSW-KZSEL(04)'
'X'.
perform bdc_field using 'MSICHTAUSW-KZSEL(05)'
'X'.
perform bdc_field using 'MSICHTAUSW-KZSEL(06)'
'X'.
perform bdc_field using 'MSICHTAUSW-KZSEL(07)'
'X'.
perform bdc_field using 'MSICHTAUSW-KZSEL(08)'
'X'.
perform bdc_dynpro using 'SAPLMGMM' '0080'.
perform bdc_field using 'BDC_CURSOR'
'RMMG1-LGORT'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_field using 'RMMG1-WERKS'
'MFPL'.
perform bdc_field using 'RMMG1-LGORT'
'ccon'.
perform bdc_dynpro using 'SAPLMGMM' '4004'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'MAKT-MAKTX'
record-maktx.
perform bdc_field using 'BDC_CURSOR'
'MARA-MATKL'.
perform bdc_field using 'MARA-MEINS'
record-meins.
perform bdc_field using 'MARA-MATKL'
record-matKl.
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'MAKT-MAKTX'
record-maktx.
perform bdc_field using 'BDC_CURSOR'
'MARC-EKGRP'.
perform bdc_field using 'MARA-MEINS'
record-meins.
perform bdc_field using 'MARC-EKGRP'
record-ekgrp.
perform bdc_field using 'MARA-MATKL'
record-matkl.
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'MAKT-MAKTX'
record-maktx.
perform bdc_field using 'BDC_CURSOR'
'MARC-DISGR'.
perform bdc_field using 'MARA-MEINS'
record-meins.
perform bdc_field using 'MARC-DISGR'
record-disgr.
perform bdc_field using 'MARC-EKGRP'
record-ekgrp.
perform bdc_field using 'MARC-DISMM'
'ND'.
perform bdc_field using 'MARC-DISPO'
record-dispo.
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'MAKT-MAKTX'
record-maktx.
perform bdc_field using 'BDC_CURSOR'
'MARC-WEBAZ'.
perform bdc_field using 'MARC-WEBAZ'
record-webaz.
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'=PB01'.
perform bdc_field using 'BDC_CURSOR'
'MAKT-MAKTX'.
perform bdc_field using 'MAKT-MAKTX'
record-maktx.
perform bdc_field using 'MARA-MEINS'
record-meins.
perform bdc_field using 'MARC-WEBAZ'
record-webaz.
perform bdc_dynpro using 'SAPLQPLS' '0100'.
perform bdc_field using 'BDC_CURSOR'
'RMQAM-ARGUMENT'.
perform bdc_field using 'BDC_OKCODE'
'=NEU'.
perform bdc_dynpro using 'SAPLQPLS' '0100'.
perform bdc_field using 'BDC_CURSOR'
'RMQAM-AKTIV(01)'.
perform bdc_field using 'BDC_OKCODE'
'=WEIT'.
perform bdc_field using 'RMQAM-ART(01)'
'ZCON'.
perform bdc_field using 'RMQAM-APA(01)'
'X'.
perform bdc_field using 'RMQAM-AKTIV(01)'
'X'.
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'MAKT-MAKTX'.
perform bdc_field using 'MAKT-MAKTX'
record-maktx.
perform bdc_field using 'MARA-MEINS'
record-meins.
perform bdc_field using 'MARC-WEBAZ'
record-webaz.
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'MAKT-MAKTX'.
perform bdc_field using 'MAKT-MAKTX'
record-maktx.
perform bdc_field using 'MARA-MEINS'
record-meins.
perform bdc_field using 'MBEW-BKLAS'
record-bklas.
perform bdc_field using 'MBEW-VPRSV'
'V'.
perform bdc_field using 'MBEW-PEINH'
'1'.
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'MAKT-MAKTX'.
perform bdc_field using 'MAKT-MAKTX'
record-maktx.
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'MAKT-MAKTX'.
perform bdc_field using 'MAKT-MAKTX'
record-maktx.
perform bdc_field using 'MARA-MEINS'
record-meins.
perform bdc_field using 'MARC-LOSGR'
'1'.
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'MAKT-MAKTX'.
perform bdc_field using 'MAKT-MAKTX'
record-maktx.
perform bdc_field using 'MBEW-BKLAS'
record-bklas.
perform bdc_field using 'MBEW-VPRSV'
'V'.
perform bdc_field using 'MBEW-PEINH'
'1'.
perform bdc_dynpro using 'SAPLSPO1' '0300'.
perform bdc_field using 'BDC_OKCODE'
'=YES'.
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'MAKT-MAKTX'
record-maktx.
perform bdc_field using 'MARC-PERKZ'
'M'.
perform bdc_field using 'BDC_CURSOR'
'MARC-MTVFP'.
perform bdc_field using 'MARC-MTVFP'
'02'.
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'MAKT-MAKTX'.
perform bdc_field using 'MAKT-MAKTX'
record-maktx.
perform bdc_field using 'MARA-MEINS'
record-meins.
perform bdc_field using 'MARC-WEBAZ'
record-webaz.
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'MAKT-MAKTX'.
perform bdc_field using 'MAKT-MAKTX'
record-maktx.
perform bdc_field using 'MARA-MEINS'
record-meins.
perform bdc_field using 'MBEW-BKLAS'
record-bklas.
perform bdc_field using 'MBEW-VPRSV'
'V'.
perform bdc_field using 'MBEW-PEINH'
'1'.
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'MAKT-MAKTX'.
perform bdc_field using 'MAKT-MAKTX'
record-maktx.
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'MAKT-MAKTX'.
perform bdc_field using 'MAKT-MAKTX'
record-maktx.
perform bdc_field using 'MARA-MEINS'
record-meins.
perform bdc_field using 'MARC-LOSGR'
'1'.
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'MAKT-MAKTX'.
perform bdc_field using 'MAKT-MAKTX'
record-maktx.
perform bdc_field using 'MBEW-BKLAS'
record-bklas.
perform bdc_field using 'MBEW-VPRSV'
'V'.
perform bdc_field using 'MBEW-PEINH'
'1'.
perform bdc_dynpro using 'SAPLSPO1' '0300'.
perform bdc_field using 'BDC_OKCODE'
'=YES'.
perform bdc_transaction using 'MM01'.
ENDLOOP.
perform close_group.
plz provide the solution
points wil b awarded
thanx and regards** Program ID : ZMAT_CREATE
** Program Desc : Material Master Creation
** Process Overview :
** Created By : R. NAGARAJAN
** Created Date : 22/08/2006
** Company Name : Infoview Technologies Limited
REPORT ZMAT_CREATE
NO STANDARD PAGE HEADING LINE-SIZE 132 MESSAGE-ID ZBDCMSG.
Internal table definition *
DATA: BEGIN OF ITAB OCCURS 0,
MATNR LIKE RMMG1-MATNR, " Material Number
MBRSH LIKE RMMG1-MBRSH, " Industry Sector
MTART LIKE RMMG1-MTART, " Material Type
WERKS LIKE RMMG1-WERKS, " Plant
LGORT LIKE RMMG1-LGORT, " Storage Location
VKORG LIKE RMMG1-VKORG, " Sales Organization
VTWEG LIKE RMMG1-VTWEG, " Distribution Channel
LGNUM LIKE RMMG1-LGNUM, " Warehouse Number
LGTYP LIKE RMMG1-LGTYP, " Storage Type
MAKTX LIKE MAKT-MAKTX, " Material Description
MEINS LIKE MARA-MEINS, " Base Unit of Measure
MATKL LIKE MARA-MATKL, " Material Group
SPART LIKE MARA-SPART, " Division
MTPOS_MARA LIKE MARA-MTPOS_MARA, "General item category group
GEWEI LIKE MARA-GEWEI, " Weight Unit
TAXKM1 LIKE MG03STEUER-TAXKM, " Tax classification material
TAXKM2 LIKE MG03STEUER-TAXKM, " Tax classification material
KONDM LIKE MVKE-KONDM, " Material Pricing Group
MTPOS LIKE MVKE-MTPOS , "ItemCategoryGroupFromMaterialMaster
MTVFP LIKE MARC-MTVFP, " Checking Group for AvailabilityCheck
TRAGR LIKE MARA-TRAGR, " Transportation group
LADGR LIKE MARC-LADGR, " Loading group
TDLINE LIKE RSTXT-TXLINE, " Text editor text line
EKGRP LIKE MARC-EKGRP, " Purchasing Group
DISMM LIKE MARC-DISMM, " MRP Type
BESKZ LIKE MARC-BESKZ, " Procurement Type
SOBSL LIKE MARC-SOBSL, " Special procurement type
PERKZ LIKE MARC-PERKZ, " Period indicator
PRMOD LIKE MPOP-PRMOD, " Forecast model
KZINI LIKE MPOP-KZINI, " Initialization indicator
AUTRU LIKE MARC-AUTRU, " Reset Forecast Model Automatically
MODAV LIKE MPOP-MODAV, " Model selection procedure
IPRKZ LIKE MARA-IPRKZ, " Period indicator for shelf life expiration date
BWTTY LIKE MBEW-BWTTY, " Valuation Category
BKLAS LIKE MBEW-BKLAS, " Valuation Class
EKLAS LIKE MBEW-EKLAS, " Valuation Class for Sales OrderStock
VPRSV LIKE MBEW-VPRSV, " Price Control Indicator
EKALR LIKE MBEW-EKALR, "MaterialIsCostedWithQuantityStructure
END OF ITAB,
*// TEXT HEADER
GT_HEAD LIKE THEAD,
*// Text lines
GT_TEXT LIKE STANDARD TABLE OF TLINE,
GW_TEXT LIKE TLINE,
Data definition *
WS_REP_CNT(6) TYPE C,
SESSION(12) TYPE C.
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-000.
PARAMETERS:
PA_GROUP LIKE APQI-GROUPID OBLIGATORY DEFAULT 'MMupload',
PA_FNAME LIKE IBIPPARMS-PATH OBLIGATORY.
SELECTION-SCREEN END OF BLOCK B1.
Include statements *
INCLUDE ZBDCREX.
At Selection Screen definition *
AT SELECTION-SCREEN ON VALUE-REQUEST FOR PA_FNAME.
*//GETTING FLAT FILE PATH
PERFORM FILE_PATH USING PA_FNAME.
Start of Selection definition *
START-OF-SELECTION.
*//UPLOADING THE FLAT FILE
PERFORM DATA_UPLOAD TABLES ITAB USING PA_FNAME.
*// BDC OPEN GROUP
PERFORM OPEN_GROUP USING PA_GROUP.
SKIP 3.
FORMAT COLOR COL_HEADING INVERSE ON.
WRITE 40 TEXT-001.
FORMAT COLOR COL_HEADING INVERSE OFF.
SKIP 1.
FORMAT COLOR COL_NEGATIVE INVERSE ON.
WRITE :/3 TEXT-002, 13 SY-MANDT, 104 TEXT-003, 113 SY-UNAME,
/3 TEXT-004, 13 SY-DATUM, 104 TEXT-005, 113 SY-UZEIT.
FORMAT COLOR COL_NEGATIVE INVERSE OFF.
LOOP AT ITAB.
WS_REP_CNT = WS_REP_CNT + 1. "To Count no. of Records Processed
PERFORM MM_UPLOAD.
ENDLOOP.
*//STATUS INDICATION
IF SY-SUBRC = 0.
SESSION = PA_GROUP.
SKIP 1.
FORMAT COLOR COL_TOTAL INVERSE ON.
WRITE: /38 TEXT-006 , WS_REP_CNT.
FORMAT COLOR COL_TOTAL INVERSE OFF.
MESSAGE S000 WITH SESSION.
ENDIF.
*// BDC CLOSE GROUP
PERFORM CLOSE_GROUP.
SET PF-STATUS 'ZMM01PF'.
AT USER-COMMAND.
CASE SY-UCOMM.
WHEN 'SESSION'.
CALL TRANSACTION 'SM35'.
WHEN 'EXIT'.
LEAVE PROGRAM.
WHEN 'CANCEL'.
LEAVE SCREEN.
ENDCASE .
FORM MM_UPLOAD *
FORM MM_UPLOAD.
REFRESH BDCDATA.
*// Create Material: Initial Screen
perform bdc_dynpro using 'SAPLMGMM' '0060'.
perform bdc_field using 'BDC_CURSOR'
'RMMG1-MATNR'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_field using 'RMMG1-MATNR'
ITAB-MATNR.
perform bdc_field using 'RMMG1-MBRSH'
ITAB-MBRSH.
perform bdc_field using 'RMMG1-MTART'
ITAB-MTART.
*// Selection Views
perform bdc_dynpro using 'SAPLMGMM' '0070'.
perform bdc_field using 'BDC_CURSOR'
'MSICHTAUSW-DYTXT(01)'.
perform bdc_field using 'BDC_OKCODE'
'SELA'.
perform bdc_dynpro using 'SAPLMGMM' '0070'.
perform bdc_field using 'BDC_CURSOR'
'MSICHTAUSW-DYTXT(01)'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
*// Organization Levels
perform bdc_dynpro using 'SAPLMGMM' '0080'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_field using 'RMMG1-WERKS'
ITAB-WERKS.
perform bdc_field using 'RMMG1-LGORT'
ITAB-LGORT.
perform bdc_field using 'RMMG1-VKORG'
ITAB-VKORG.
perform bdc_field using 'RMMG1-VTWEG'
ITAB-VTWEG.
perform bdc_field using 'RMMG1-LGNUM'
ITAB-LGNUM.
perform bdc_field using 'RMMG1-LGTYP'
ITAB-LGTYP.
*// Basic Data 1: Screen
perform bdc_dynpro using 'SAPLMGMM' '4004'.
perform bdc_field using 'BDC_OKCODE'
'=SP04'.
perform bdc_field using 'MAKT-MAKTX'
ITAB-MAKTX.
perform bdc_field using 'MARA-MEINS'
ITAB-MEINS.
perform bdc_field using 'MARA-SPART'
ITAB-SPART.
perform bdc_field using 'MARA-MTPOS_MARA'
ITAB-MTPOS_MARA.
perform bdc_field using 'BDC_CURSOR'
'MARA-GEWEI'.
perform bdc_field using 'MARA-BRGEW'
'9000'.
perform bdc_field using 'MARA-GEWEI'
ITAB-GEWEI.
perform bdc_field using 'MARA-NTGEW'
'8000'.
*// Sales: Sales Organization 1: Screen
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'=SP05'.
perform bdc_field using 'MG03STEUER-TAXKM(01)'
ITAB-TAXKM1.
perform bdc_field using 'MG03STEUER-TAXKM(02)'
ITAB-TAXKM2.
perform bdc_dynpro using 'SAPLMGMM' '4200'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_OKCODE'
'=SP05'.
*// Sales: Sales Organization 2: Screen
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'=SP06'.
perform bdc_field using 'BDC_CURSOR'
'MVKE-KONDM'.
perform bdc_field using 'MVKE-KONDM'
ITAB-KONDM.
perform bdc_field using 'MARA-MTPOS_MARA'
ITAB-MTPOS_MARA.
perform bdc_field using 'MVKE-MTPOS'
ITAB-MTPOS.
*// Sales: General / Plant Screen
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'=SP12'.
perform bdc_field using 'MARA-MEINS'
ITAB-MEINS.
perform bdc_field using 'MARA-BRGEW'
'9000'.
perform bdc_field using 'MARA-GEWEI'
ITAB-GEWEI.
perform bdc_field using 'MARA-XCHPF'
perform bdc_field using 'MARA-NTGEW'
'8000'.
perform bdc_field using 'MARC-MTVFP'
ITAB-MTVFP.
perform bdc_field using 'BDC_CURSOR'
'MARC-LADGR'.
perform bdc_field using 'MARA-TRAGR'
ITAB-TRAGR.
perform bdc_field using 'MARC-LADGR'
ITAB-LADGR.
*// MRP 1: Screen
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'=SP13'.
perform bdc_field using 'MARA-MEINS'
ITAB-MEINS.
perform bdc_field using 'MARC-EKGRP'
ITAB-EKGRP.
perform bdc_field using 'BDC_CURSOR'
'MARC-DISMM'.
perform bdc_field using 'MARC-DISMM'
ITAB-DISMM.
*// MRP 2: Screen
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'=SP14'.
perform bdc_field using 'BDC_CURSOR'
'RMMG1_BEZ-WERKS_BEZ'.
perform bdc_field using 'MARC-BESKZ'
ITAB-BESKZ.
perform bdc_field using 'MARC-SOBSL'
ITAB-SOBSL .
*// MRP 3: Screen
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'=SP16'.
perform bdc_field using 'BDC_CURSOR'
'MARC-PERKZ'.
perform bdc_field using 'MARC-PERKZ'
ITAB-PERKZ.
perform bdc_field using 'MARC-MTVFP'
ITAB-MTVFP.
*// Forecasting Screen
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'=SP17'.
perform bdc_field using 'BDC_CURSOR'
'MPOP-PRMOD'.
perform bdc_field using 'MARA-MEINS'
ITAB-MEINS.
perform bdc_field using 'MPOP-PRMOD'
ITAB-PRMOD.
perform bdc_field using 'MARC-PERKZ'
ITAB-PERKZ.
perform bdc_field using 'MPOP-PERAN'
'60'.
perform bdc_field using 'MPOP-ANZPR'
'12'.
perform bdc_field using 'MPOP-KZINI'
ITAB-KZINI.
perform bdc_field using 'MPOP-SIGGR'
'4.000'.
perform bdc_field using 'MARC-AUTRU'
ITAB-AUTRU.
perform bdc_field using 'MPOP-MODAV'
ITAB-MODAV.
*// Work Scheduling Screen
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'=SP19'.
perform bdc_field using 'BDC_CURSOR'
'MARC-FRTME'.
perform bdc_field using 'MARA-MEINS'
ITAB-MEINS.
*// Plant data / Stor. 1: Screen
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'=SP20'.
perform bdc_field using 'BDC_CURSOR'
'MAKT-MAKTX'.
perform bdc_field using 'MARA-MEINS'
ITAB-MEINS.
perform bdc_field using 'MARA-IPRKZ'
ITAB-IPRKZ.
*// Plant data / Stor. 2: Screen
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'=SP21'.
perform bdc_field using 'BDC_CURSOR'
'MAKT-MAKTX'.
perform bdc_field using 'MARA-BRGEW'
'9000'.
perform bdc_field using 'MARA-GEWEI'
ITAB-GEWEI.
perform bdc_field using 'MARA-NTGEW'
'8000'.
*// Warehouse Management 1: Screen
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'=SP23'.
perform bdc_field using 'BDC_CURSOR'
'MAKT-MAKTX'.
perform bdc_field using 'MARA-MEINS'
ITAB-MEINS.
perform bdc_field using 'MARA-BRGEW'
'9000'.
perform bdc_field using 'MARA-GEWEI'
ITAB-GEWEI.
*// Quality Management Screen
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'=SP24'.
perform bdc_field using 'BDC_CURSOR'
'MAKT-MAKTX'.
perform bdc_field using 'MARA-MEINS'
ITAB-MEINS.
*// Accounting 1: Screen
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'=SP26'.
perform bdc_field using 'MARA-MEINS'
ITAB-MEINS.
perform bdc_field using 'MBEW-BWTTY'
ITAB-BWTTY.
perform bdc_field using 'MARA-SPART'
ITAB-SPART.
perform bdc_field using 'BDC_CURSOR'
'MBEW-STPRS'.
perform bdc_field using 'MBEW-BKLAS'
ITAB-BKLAS.
perform bdc_field using 'MBEW-EKLAS'
ITAB-EKLAS.
perform bdc_field using 'MBEW-VPRSV'
ITAB-VPRSV.
perform bdc_field using 'MBEW-PEINH'
'1'.
perform bdc_field using 'MBEW-VERPR'
'800'.
perform bdc_field using 'MBEW-STPRS'
'800'.
*// Costing 1: Screen
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'=SP27'.
perform bdc_field using 'BDC_CURSOR'
'MAKT-MAKTX'.
perform bdc_field using 'MARA-MEINS'
ITAB-MEINS.
perform bdc_field using 'MBEW-EKALR'
ITAB-EKALR.
perform bdc_field using 'MARC-LOSGR'
'1'.
*// Costing 2: Screen
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'=BABA'.
perform bdc_field using 'BDC_CURSOR'
'MAKT-MAKTX'.
perform bdc_field using 'MBEW-BKLAS'
ITAB-BKLAS.
perform bdc_field using 'MBEW-BWTTY'
ITAB-BWTTY.
perform bdc_field using 'MBEW-EKLAS'
ITAB-EKLAS.
perform bdc_field using 'MBEW-VPRSV'
ITAB-VPRSV.
perform bdc_field using 'MBEW-PEINH'
'1'.
perform bdc_field using 'MBEW-VERPR'
'800.00'.
perform bdc_field using 'MBEW-STPRS'
'800.00'.
perform bdc_dynpro using 'SAPLSPO1' '0300'.
perform bdc_field using 'BDC_OKCODE'
'=YES'.
*//BDC INSERT
PERFORM BDC_TRANSACTION TABLES BDCDATA
USING 'MM01'. " MESSAGES INTO GT_MSG.
*// Text Header Data
CONCATENATE ITAB-MATNR ' 000101'
INTO GT_HEAD-TDNAME .
GT_HEAD-TDOBJECT = 'MVKE' .
GT_HEAD-TDID = '0001' .
GT_HEAD-TDSPRAS = SY-LANGU.
*// Sales Text
GW_TEXT-TDFORMAT = '00'.
GW_TEXT-TDLINE = ITAB-TDLINE .
APPEND GW_TEXT TO GT_TEXT.
CALL FUNCTION 'SAVE_TEXT'
EXPORTING
CLIENT = SY-MANDT
HEADER = GT_HEAD
INSERT = 'X'
SAVEMODE_DIRECT = 'X'
OWNER_SPECIFIED = ' '
TABLES
LINES = GT_TEXT
EXCEPTIONS
ID = 1
LANGUAGE = 2
NAME = 3
OBJECT = 4
OTHERS = 5.
IF SY-SUBRC 0.
SKIP 2.
FORMAT COLOR COL_NEGATIVE INVERSE ON.
WRITE: / 'Unable to Insert Salestext for Material : ', ITAB-MATNR .
FORMAT COLOR COL_NEGATIVE INVERSE OFF.
ENDIF.
CLEAR: GT_HEAD, GT_TEXT, GW_TEXT.
ENDFORM. "MM_UPLOAD -
F-28 BDC problem when not debugging
Hello friends,
I have developed a BDC for the TCODE F-28 and everything works fine when i do in debug mode. NO problem at all. However when I do a no screen and if I am not debugging, it posts the invoice for one record and from second record on it fails.
ANy suggestions as what could be the reason for this.
ShreekantTry to give WAIT after the first record call. May this will help you out.
a® -
Dear all,
there is problem in BDC MIGO report. when i uploaded the p_file the bdc run but on some fields it gives the error message
S Field GOITEM-ERFME . is not an input field
S Field GOITEM-ERFMG . is not an input field
S Field GOITEM-LSMNG . is not an input field
S Field GOITEM-LSMEH . is not an input field
S Field GOITEM-BWART . is not an input field
S Field GOITEM-LGOBE . is not an input field
S Field GOITEM-WEMPF . is not an input field
S Field GOITEM-ABLAD . is not an input field
S Field GOITEM-SGTXT . is not an input field
these are all input fields and i defiend as
perform bdc_field using 'BDC_CURSOR'
'GOITEM-ERFME'.
perform bdc_field using 'GOITEM-ERFME'
IT_DATA-ERFME.
perform bdc_field using 'GOITEM-ERFMG'
IT_DATA-ERFMG.
perform bdc_field using 'GOITEM-LSMNG'
IT_DATA-LSMNG.
perform bdc_field using 'GOITEM-LSMEH'
IT_DATA-LSMEH.
*perform bdc_field using 'GOITEM-MIGO_ELIKZ'
'1'.
perform bdc_field using 'GOITEM-BWART'
'101'.
perform bdc_field using 'GOITEM-LGOBE'
IT_DATA-LGOBE.
perform bdc_field using 'GOITEM-WEMPF'
IT_DATA-WEMPF.
perform bdc_field using 'GOITEM-ABLAD'
IT_DATA-ABLAD.
perform bdc_field using 'GOITEM-SGTXT' "
IT_DATA-SGTXT.
please solve my problem.
Regards,
PankajHI,
May this will throw some light for u
Geting problem in BDC prog of MIGO transaction
Regards,
Aditya -
Hi.
I have a BDC code which runs fine using call transaction VF01 and Mode = 'A'.
But when I run it in Mode = N, its not executed. Invoice is not created.
Any idea?
I tried with other options like Update = 'S' and 'A' and 'L'.
My code is as below ::
FORM GET_OPENORDERS.
SELECT VBELN ERDAT VKORG LFART FROM LIKP INTO TABLE ITAB_LIKP WHERE VKORG = '3010'.
SELECT VBELN XBLNR FROM VBAK INTO TABLE ITAB_VBAK WHERE
VBELN = '0000000483'.
AUART = 'ZCKD' OR
AUART = 'ZEXS' OR
AUART = 'ZCLM' OR
AUART = 'ZISO' OR
VKORG = '3010' AND
VTWEG = '30' AND
SPART = '30' AND
ERDAT = SY-DATUM.
IF NOT ITAB_VBAK[] IS INITIAL.
SELECT VBELN VBTYP FROM VBUK INTO TABLE ITAB_VBUK FOR ALL ENTRIES IN ITAB_VBAK
WHERE
VBELN = ITAB_VBAK-VBELN AND
LFSTK = 'C' AND " DELIVERY STATUS : COMPLETED
LFGSK = 'C' AND " OVER ALLDELIVERY STATUS : COMPLETED
FKSAK NE 'C' AND " BILLING STATUS ORDER : NOT COMPLETED
VBTYP = 'C'. " DOC TYPE = ORDERS
ENDIF.
ENDFORM. " GET_OPENORDERS
*& Form CREATE_INVOICE
text
--> p1 text
<-- p2 text
FORM CREATE_INVOICE .
LOOP AT ITAB_VBUK.
DO.
READ DATASET DATASET INTO RECORD.
IF SY-SUBRC <> 0. EXIT. ENDIF.
PERFORM BDC_DYNPRO USING 'SAPMV60A' '0102'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'0000000464'.
ITAB_VBUK-VBELN.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'/00'.
PERFORM BDC_FIELD USING 'KOMFK-VBELN(01)'
ITAB_VBUK-VBELN.
RECORD-VBELN_01_001.
PERFORM BDC_DYNPRO USING 'SAPMV60A' '0104'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'ZESO'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=SICH'.
PERFORM BDC_TRANSACTION USING 'VF01'.
ENDDO.
WAIT UP TO 1 SECONDS.
CALL TRANSACTION 'VF01' USING BDCDATA MODE 'N'
UPDATE 'S'
MESSAGES INTO MESSTAB.
COMMIT WORK AND WAIT.
CLEAR: BDCDATA, MESSTAB.
REFRESH: BDCDATA, MESSTAB.
ENDLOOP.
PERFORM CLOSE_GROUP.
PERFORM CLOSE_DATASET USING DATASET.
loop at MESSTAB.
write : Messtab.
endloop.
ENDFORM. " CREATE_INVOICE
Start new screen *
FORM BDC_DYNPRO USING PROGRAM DYNPRO.
CLEAR BDCDATA.
BDCDATA-PROGRAM = PROGRAM.
BDCDATA-DYNPRO = DYNPRO.
BDCDATA-DYNBEGIN = 'X'.
APPEND BDCDATA.
ENDFORM. "BDC_DYNPRO
Insert field *
FORM BDC_FIELD USING FNAM FVAL.
IF FVAL <> SPACE.
CLEAR BDCDATA.
BDCDATA-FNAM = FNAM.
BDCDATA-FVAL = FVAL.
APPEND BDCDATA.
ENDIF.
ENDFORM. "BDC_FIELDHi All,
Thanks for the replies.
Just adding my comments here.
We need to do the saperate recording for this problem.
In SHDB, we have to select "Simulate Background Mode"
My problem is solved.
Adding here so that it will appear in teh search results for others....
May be.. cheers, -
Fs00 bdc problem in ticking checkbox fields
Hello All,
I have written bdc for tcode FS00 for gl master record upload but im getting error while uploading.
In flat file i have putted value 'x' for posting without tax allowed, manage in local currency,open item and line item but when im running a bdc the checkboxes are getting checked but im getting the error "enter a valid value"
If i create every account manually and tick the checkbox thn its not giving error but in bdc program if i m putting tick in checkbox im getting error
Pls let me knw is there any other value of checkbox other thn 'x'?
Thnks
Sunnyhi Sunny,
just rin the BDS in mode A (show all screens) or E (stop at error), so that you'll see what is exactly the problem. I assume the problem is somewhere else (not by the checkboxes), for another field you enter a wrong value, which is not accepted by the system. Just check, where the cursor is placed, right after the error message!
hope this helps
ec -
Hi Experts,
I am running a BDC for VA01 transaction, it is working fine when customer is not having incompletion log, but my problem is suppose customer is having incompletion log that time in Va01 it is showing one report which indicates all the error against that customer in ALV format.
When i am trying to record that report that time recording is going up to report but it is not coming out from there.
I am already capturing standard messages but it is not capturing the report error, i have discussed with functional team they are saying for them that report itself is error.
Can any one help me on this if customer is having any incompletion log in va01 how to capture that in bdc.Hi,
You may well be able to get around this by using BAPI_SALESORDER_CREATEFROMDAT2 instead of a BDC - it has a parameter "BEHAVE_WHEN_ERROR" that may let you save the document even with the incompletion entries. The users would then just have to process the entries later via VA02 but that should be part of a normal business process anyway.
Gareth. -
BDC problem session hangs on F4.
Hi all,
suppose a material code has been created using mm01, know while performing
valuation extension of this material code through bdc call transaction method ,
Problem arises when a wrong plant is given through flat file to a particular matnr ,
a pop up window appears with a message , matnr is not matained for this plant,
But know if after cancelling this pop up window and opening the search help in the plant field which shows the correct plant for which the material code matained, the system hangs here neither it allows to select this correct plant from search help,
and nor it closes this window there after . hence after altctrldel has to be done due to which all other session and whole sap session gets close .
Pls provide your valuable suggestions on this problem
thanks in advance ,
Regards,
VivekHi!
Try not solve this problem in BDC. Write your coding into the ABAP section.
For example if there is a possible wrong plant, then search after it first.
like: SELECT SINGLE werks FROM marc INTO lv_werks WHERE matnr = lv_matnr.
If the werks (plant) is not correct, then use the plant from the select in the BDC.
BDC is not very good for error handling.
Regards
Tamá -
Hi,
We are facing the problem to run the BDC.
Actually problem is that we are using the UBUNTU instead of Window XP / Server and Open Office instead of Microsoft Office..
File extension of Open Excel is .ODS & Microsoft Excel extension is .XLS. Also our BDC is supporting the .XLS extension files.
Is there any way to use the .ODS extension file in my BDC. Is it possible that if i change the code somewhere and use .ODS file, my BDC should run..
How to upload my .ODS file in BDC?? or any other way to make my BDC successful??
Thanks...
Edited by: @ABAP@ on Oct 10, 2009 5:57 PMHi,
There are few things that I need you to check:
1.Make sure your file is not open while executing the eport
2.Declare internal table with all fields as Char type haning the length same as defined in the backend.
3.You can either upload the XLs file using the direct FM TEXT_convert_xls_to_sap
or save the xls file as the tabdeliminator file and use the Fm GUI_UPLOAD.
4.FM GUI_DOWNLOAD is used to download any fiel data to the presentaion server.
Hope now your problem will be solved.
Pooja -
Hi All,
I have developed BDC for FF67 transaction ,
Am having a problem in that , My problem is that the second screen number, where we enter line items, is different in development server and different in production server.
In development am having second screen number as 8001 and in production server am having screen number as 8000.
I want to know why the screen number is different in two servers.
Regards,
Bharat.
Edited by: bharat tambat on Nov 6, 2008 3:21 PM
am waiting for reply...
Edited by: bharat tambat on Nov 7, 2008 6:23 AMHi Bharat
Probably too late for an advice but always try using a BAPI for SAP posting.
Go for BDC only if one is not available !!
Re: Regd : BAPI might interest you.
Neeraj
Maybe you are looking for
-
IMac trying to connect to another iMac
my iMac is trying to connect to my other iMac on my network whenever I login to this imac how do I turn this off? Thanks for any help.
-
Managing threshold value of document library
Hi, We are managing below stuff through .net application 1)Uploading the document to current Month folder in a document library , While uploading a document check for the current month folder , if it does not exists create a new folder with month an
-
Is there a way to rename a share in Leopard?
Before Leopard is was possible to use the utility Sharepoints to rename a share without changing the name of the folder that was being shared. I have not yet found a way to rename a share using the Sharing preference in Leopard. Any know of a way to
-
File adapter initiated process
I've created a simple process that is supposed to start by polling for a file and reading it then deleting the file. The process is deployed and the file is in the correct directory but the process is never started. The file remains in the directory.
-
Why doesn't Web Proxy Server use default route?
After downloading Sun Java Web Proxy Server, I notice that the path to retrieve URLs from the internet does not go out the default route. However my pings, traceroutes, telnets, etc. to the same URLs do go out to the default route correctly. I have t