F-32 Transaction BDC Problem
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 Yeruva
Hi 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
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 -
SM35 ( Transaction BDC is unknown)
Hi, i have the next problem:
I execute the program RV14BTCI that create a Session in SM35. When i execute the session this end succesfully and show me the options of exit or resume BI, not matter what opcion i chose the system show me the error messaje "Transaction BDC is unknown" somebody knows what could be the reason of that?
Thanks in advanceRead this [Note 1590735 - Transaction selection screen or Easy Access after pushbutton|https://service.sap.com/sap/support/notes/1590735]
For example, the navigation to the session overview no longer works after completing the run of a batch input session from SM35. Instead of the session overview, the system displays the transaction selection screen with the error message 00 031 "Transaction BDC is unknown".
Ask basis to upgrade your Kernel SP (...)
Regards,
Raymond -
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á -
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. -
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 -
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, -
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. -
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 -
BDC problem (reward)
hi
iam dng bdc for transaction pa30.in my bdc there r 2 columns n it consist of 15 records(rows) n it is filling 12 records n remaining 3 record when iam pressing p++ ok-code.
So my problem is that it is filling first 12 rows correctly but when iam pressing p++ ok-code,for remaining 3 rows 2nd column is filling but my 1st column is not filling the records in it n also my 2nd column is in display mode.HI,
R u getting any errors while creating using 'A'.
If not then use commit work after BDC.
Thanks -
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 .
regardsREPORT 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 -
MDB Transaction Management Problem
Hi,
I am implementing a container managed MDB. The process involves implementing the retry queue and a dead letter queue in case the message is not processed properly.
In one of the scenarios, an exception gets thrown during the message processing and the message is sent to the retry queue. But somehow it is not being delivered to this queue also and an exception gets thrown. I can see the stacktrace in the logs but somehow This exception is not causing my transaction to rollback in the original MDB and hence the message is getting lost.
I am using WSAD 5.1 with websphere app server.
Can someone help please.Hi,
Thanks for your reply.
Unfortunatelly, I didn't find any information about that issue in Release Notes of Service Pack 5.
Could you show me any source of information about this problem as it is known issue ? -
JDBC, JMS and EJB transactions - possible problem?
Hello,
I am using Oracle 9, Weblogic 8.1 SP 4, MyEclipse and
XDoclet.
In my current project I have the following piece of code
in one of my message driven beans (code cited as pseudocode
without unnecessary details):
* @ejb.bean name="MyMessageProcessor"
* display-name="Display name for a MyMessageProcessor"
* jndi-name="ejb/MyMessageProcessor"
* description="Bean MyMessageProcessor"
* destination-type="javax.jms.Queue"
* transaction-type="Container"
* acknowledge-mode="Auto-acknowledge"
* subscription-durability="Durable"
* generate="false"
* @ejb.transaction type="Required"
public class MyMessageProcessor implements MessageDrivenBean, MessageListener {
public void onMessage(Message msg) {
try {
//obtaining connections to two different databases via JNDi
java.sql.Connection connOne =
((DataSource)ctx.lookup("DataSourceOne")).getConnection();
java.sql.Connection connTwo =
((DataSource)ctx.lookup("DataSourceTwo")).getConnection();
// performing some UPDATEs and INSERTs on connOne and connTwo
// calling some other methods of this bean
//creating the reply JMS message and sending it to another JMS queue
Message msgTwo = this.createReplyMessage(msg)
this.queueSender.send(msgTwo);
//commiting everything
this.queueSession.commit();
} catch (Exception ex) {
try {
if (this.queueSession!=null) this.queueSession.rollback();
} catch (JMSException JMSEx) {};
this.context.setRollbackOnly();
Some days ago (before the final remarks from my client) there used to be only one DataSource configurated on the basis of the
connection pool with non-XA jdbc driver. Everything worked fine
including the transactions (if anything wrong happend not only wasn't the replymessage sent, but also no changes were written
to database and the incomming message was thrown back to the my bean's
queue).
When I deployed the second DataSource I was informed by an error message, that only one non-transactional resource may
participate in a global transaction. When I changed both datasources
to depend on underlying datasources with transatcional (XA) jdbc drivers, everything stopped working. Even if
EJB transaction was theoretically successfully rolledbacked, the changed were written to the database
and the JMS message wasn't resent to the JMS queue.
So here are my questions:
1. How to configure connection pools to work in such situations? What JDBC drivers should I choose?
Are there any global server configurations, which may influence this situation?
2. Which jdbc drivers should I choose so that the container was able to rollback the database transactions
(of course, if necessary)?
3. Are there any JMS Queue settings, which would disable the container to send message back to the
queue in case of setRollbackOnly()? How should be the Queue configurated?
As I am new to the topic and the deadline for the project seems to be too close I would be grateful
for any help.
This message was sent to EJB list and JDBC list.
Sincerely yours,
Marcin ZakidalskiHi,
I found these information extremely useful and helpful.
The seperate transaction for sending messages was, of course, unintentional. Thanks a lot.
Anyway, I still have some problems. I have made some changes to the
code cited in my previous mail. These changes included changing QueueSessions
to non-transactional. I also set the "Honorate global transactions" to true.
I am using XA JDBC driver. After setting "Enable local transactions" to false
(I did it, because I assume that JDBC transactions should be part on the global
EJB transaction) I got the following error:
java.sql.SQLException: SQL operations are not allowed with no global transaction by default for XA drivers. If the XA
driver supports performing SQL operations with no global transaction, explicitly allow it by setting
"SupportsLocalTransaction" JDBC connection pool property to true. In this case, also remember to complete the local
transaction before using the connection again for global transaction, else a XAER_OUTSIDE XAException may result. To
complete a local transaction, you can either set auto commit to true or call Connection.commit() or Connection.rollback().
I have also inspected the calls of methods of bean inside of onMessage() method just to check, whether
the transactions are correctly initialized (using the weblogic.transaction.Transaction class).
My questions are as follows:
1. Any suggestions how to solve it? I have gone through the google answers on that problem and only
thing I managed to realize that JDBC must start its own transaction. Is there any way to prohibit it
from doing that? Can using setAutocommit(true/false) change the situation for better?
2. How to encourage the JDBC driver to be a part of EJB transaction?
3. As I have noticed each of ejb method has its own transactions (transactions have different
Xid). Each method of the bean has "required" transaction attribute. Shouldn't it work in such
way that if already started transaction exists it is used by the called method?
4. The DataSources are obtained in my application via JNDI and in the destination environment I will have slight
impact on the configuration of WebLogic. What is least problematic and most common WebLogic configuration which would
enable JDBC driver to participate in the EJB transaction? Is it the WebLogic configuration problem or can it be
solved programmically?
Currently my module works quite fine when "enable local transactions" for DataSources is set to true, but this way
I am loosing the ability to perform all actions in one transaction.
Any suggestions / hints are more than welcomed. This message was posted to jdbc list and ejb list.
Marcin
Maybe you are looking for
-
I was excited when my iPhone 4sarrived yesterday. I charged it but today when I tried to download iTunes in order to activate the phone I found that I was unable to download it successfully. I keep getting a message that tells me to Verify that the p
-
Why does NI CAN Example use NI CVI?
Hello, when you buy a NI CAN Case (e.g. USB<->CAN: NI USB 8473) and install the drivers, the examples are also installed. When you open the example C:\Programme\National Instruments\LabVIEW 2012\examples\nican\Frame - Basic.llb you will see that the
-
How to open a browser from a program??
How can i open a browser to a specific page from my aplication??
-
Browsing too slow on wifi on my iphone5
I've had my iphone 5 for a week now, signal strength from my home wifi is excellent but when i surf the web (safari and the other apps) its just too slow,mediocre to say the least! most of the time webpages dont ever open! funny thing is my old iphon
-
Music app not working on iOS 8 bsosoft free music download
free music app bsosoft download won't play songs since ios 8