
Its a year of BDC for me.... :cool:
this is my first Blog .. :smile:
In this Blog i'm sharing how to create Recipe using BDC and issues which I faced while creating BDC for Recipe Creation C201.
Before recipe creation we need to know about BOM and its creation
In my previous Document I have explained in detail about BOM and its creation
Recipe Creation
Definition :
Recipe is nothing but planning of manufacturing of products and Recipe is a collection resources .
Recipe is a collection of resources with well planned for manufacturing a product .
Recipe is basis for Product costing as well as reference for Process Orders.
Recipe will be created for a material and Plant for which BOM already created , moreover BOM is like reference for Recipe
Initial Screen
Parts of Recipe :
1.Recipe Group
It is unique Key to identify Recipe Group .
2.Recipe
It is a key to differentiate Recipe among Master recipe Group.
3.Material and Plant
Material and Plant are the reference for Recipe Creation .
4. Production Version
It is a relation between BOM Header and Recipe based on Alt BOM used .
Production version is is used to define different methods of Production through which a material can be produced.
Second Screen : Recipe Header
5. Status :
Status is used to identify the processing status of Recipe .
In general Released status is preferred for Task list status.
For Cost BOM , status 3 is preferred.
6. Usage
Usage is used to indicate for what purpose recipe is used, for ex like recipe used for production or review ..,
Usage values are Organisation dependent .
7.Planner Group
Planner Group is used for Recipe maintenance .
Planner Group values are changed as per Organisation Requirement .
Third Screen : Operations
Standard Values
Standard values are used in customization of work center
8.Operation/Activity Number
It is key which identifies the sequence of operations .
In general the Operations are in sequence of 0010,0020...,
9.Phase Indicator /SUB Operation/Destination
In order to maintain relation between Operations we need to create SUB Operations .
Three values need to provided to create sub operations :
a.Phase Indicator
b.Sub Operation
c. Destination
a.Phase indicator
It is a checkbox , which is used to indicate whether the operation is sub operation or not .
b.Sub Operation :
It is used to define for which Operation Sub Operation need to be Assigned .
In the above example , 0010 is Operation and 0020 is sub operation .
c.Destination
Destination is used to identify Recipe Destination with in plant
10.Resource
It is the center of recipe creation and it is a key to identify resource in a plant.
11.control Key
It is use to define which transactions should be executed for Recipe like scheduling or costing ..,
Create Relationship between Operations
To create relation between operations No. of Operations Should be Atleast 4 .
How to create ?
select all Operations by clicking on select all Button
then click on Generate Relation Button at the bottom to generate relations
Fourth Screen : Materials
before entering 4th Screen we need to create Production version and assign Alt BOM to Production Version .
On click of Materials Tab new popup will appear with Production version as shown below :
Assign Phases to BOM Items
Based on the requirement assign Phases created in Operation Tab to Particular BOM Items by selecting Materials and by clicking on the create assignment button at the Bottom .
A new POP up will appear to assign Phases as shown below :
After assigning phases to the necessary BOM Components as below , save the recipe which will create recipe .
In the above screen if we click on BOM Icon , it will enroute to BOM details .
BDC for Recipe Creation
Let me introduce the major Issues which i have faced with creating BDC for Recipe Creation
1. Page Down Issue
2. Selection and deselection of Operations
BDC code for Recipe Creation Tcode - C201
The Major problem which I faced while creating recipe with more than 10 records is Page Down error .
what is Page Down Error ?
After entering in to second page or more than that suddenly cursor moves to fist page while filling details in second page .
when it occurs ?
This Issue I faced at two places
1. after entering Standard values (1st standard value, 2nd standard value ...)
2.After entering Charge Qty in standard values screen .
what is charge Qty , when it is calculated ?
Charge Qty is division of base Qty by operation Qty and it is calculated for Resources with different UOM from Base UOM.
In the current scenario by default system allowing to enter 10 records w/o page down , for morethan 10 records I have decided Divided entire BDC program of recipe creation into 3 sections :
1. Enter all the Resources
2.Assign Standard values if entered for the Resources
3.Assign Classification Class and Additional resources.
What is Classification class ?
According to the Requirement we can assign differentiate similar group of recipe's based on Classification class.
How to assign Classification class to particular Operation ?
step1 : select created operation
step 2 : Click on resource selection criteria as shown below
step3 : fill the classification filed with necessary class name and assign the class
Assign Additional resources :
Additional resc. are nothing but Recipe-specific values are assigned to the characteristics of this class.
After entering classification class , Additional resources Tab will be enabled as shown below.
So finally I divided my entire BDC programming into 3 sections as mentioned above
sample Scenario :
Create Recipe for material BOM with charge QTy and Additional resources
Tcode for Recipe Creation C201 .
Step 1: create Recording through SHDB t.code and save it
step 2 : Create a Report in se38 and define Required declarations
Step 3 : replace all the Hard coded values with variables .
*---------------------------------------------------------------------------------------------*
* BDC for Recipe Creation *
*---------------------------------------------------------------------------------------------*
DATA : lv_matnr TYPE rc27m-matnr,
lv_stlal TYPE mast-stlal,
lv_verid TYPE mkal-verid,
lv_phseq TYPE plpo-phseq,
lv_losbs TYPE char13,
lv_bstma TYPE char13,
lv_bstmi TYPE char13,
gd_msg TYPE string,
lv_date TYPE rn1datum-datex,
lv_slno TYPE zsl_no,
l_msg TYPE bapi_msg,
lit_bom_item TYPE TABLE OF zsbom_items,
wa_bom_item TYPE zsbom_items,
lit_mkal TYPE STANDARD TABLE OF mkal,
wa_mkal TYPE mkal,
lit_plko TYPE TABLE OF plko,
wa_plko TYPE plko,
lit_plpo TYPE TABLE OF plpo,
wa_plpo TYPE plpo,
lit_inob TYPE TABLE OF inob,
wa_inob TYPE inob,
lit_ausp TYPE TABLE OF ausp,
wa_ausp TYPE ausp,
lit_return TYPE TABLE OF bapiret2,
wa_return TYPE bapiret2,
lit_hist_msg TYPE TABLE OF zthist_msgs,
wa_hist_msg TYPE zthist_msgs,
lv_plnnr TYPE rc271-plnnr,
lv_plnal TYPE rc271-plnal,
lv_losvn TYPE rc271-losvn,
lv_stlan TYPE mast-stlan,
lv_len TYPE i,
lv_lines TYPE i,
lv_phassign TYPE zsbom_items-zph_assign,
lv_text TYPE char40,
lv_maktx TYPE maktx,
lv_prod_desc TYPE maktx,
lv_plnkn TYPE plnkn,
lv_objek TYPE inob-objek,
lv_cuobj TYPE inob-cuobj,
lv_chrg_qty TYPE string,
lv_temp TYPE n,
lv_res(2) TYPE n,
lv_pgdwn TYPE i,
lv_pgdwn1 TYPE i,
lv_index TYPE i,
lv_index1 TYPE i,
lv_index2 TYPE i,
lv_lst_ind(4) TYPE n,
lv_flg(1) TYPE c,
lv_ph_sel(4) TYPE n,
lit_recipe_head_rep TYPE TABLE OF ztrecipe_h_rep,
wa_recipe_head_rep TYPE ztrecipe_h_rep,
wa_recipe_head_rep1 TYPE ztrecipe_h_rep,
lit_recipe_itm_rep TYPE TABLE OF ztrecipe_i_rep,
wa_recipe_itm_rep TYPE ztrecipe_i_rep,
wa_recipe_itm_rep1 TYPE ztrecipe_i_rep,
gd_num TYPE i, "operation tab
gd_num1 TYPE i,
gd_num2 TYPE i,
gd_cnt(2) TYPE c,
gd_cnt1(2) TYPE c,
gd_arbpl(25) TYPE c,
gd_ltxa1(25) TYPE c,
gd_phflg(25) TYPE c,
gd_pvznr(25) TYPE c,
gd_phseq(25) TYPE c,
gd_steus(25) TYPE c,
gd_ltxa1_p(25) TYPE c,
gd_vgw01(25) TYPE c,
gd_vgw02(25) TYPE c,
gd_vgw03(25) TYPE c,
gd_vgw04(25) TYPE c,
gd_vgw05(25) TYPE c,
gd_vgw06(25) TYPE c,
gd_vge06(25) TYPE c,
gd_vornr(25) TYPE c,
gd_flg(25) TYPE c,
gd_bsmch(25) TYPE c,
gd_qty_tmp(14) TYPE c,
gd_atwrt(25) TYPE c,
gd_meinh(25) TYPE c,
gd_vge(25) TYPE c,
gd_chrg_qty TYPE string,
lr_bom TYPE REF TO zcl_bom.
DATA: ld_num TYPE i,
ld_num1 TYPE i,
ld_tmp1(25) TYPE c,
ld_cnt(2) TYPE c,
ld_idnrk(25) TYPE c,
ld_vornr(25) TYPE c,
ld_flg(25) TYPE c,
ld_cnt1(4) TYPE n,
ld_cnt2(4) TYPE n,
ld_cnt3(4) TYPE n,
ld_cnt4(4) TYPE n,
lv_tabix TYPE i,
lv_count(4) TYPE n,
ld_tmp_m TYPE i,
ld_tmp_n TYPE i.
TYPES : BEGIN OF ty_class,
atinn TYPE cabn-atinn,
END OF ty_class.
DATA : wa_class TYPE rmslv_char_class.
*-->Processing
lr_bom = zcl_bom=>get_instance( ).
*------------------------------------------------------*
* CONVERSIONS *
*------------------------------------------------------*
CALL FUNCTION 'FORMAT_DATE_4_OUTPUT'
EXPORTING
datin = sy-datum
format = 'DD.MM.YYYY'
IMPORTING
datex = lv_date.
lv_matnr = im_recipe_h-matnr.
lv_verid = im_recipe_h-verid. "verid
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT' "Convert Material
EXPORTING
input = lv_matnr
IMPORTING
output = lv_matnr.
*-->get corresponding data
MOVE-CORRESPONDING im_recipe_h TO wa_recipe_h.
*-->get material description
SELECT SINGLE maktx FROM makt INTO wa_recipe_h-maktx WHERE matnr = lv_matnr.
lv_werks = wa_recipe_h-werks.
lv_prof = wa_recipe_h-profidnetz. "pi01
lv_stat = wa_recipe_h-statu." wa_recipe_h-statu.
lv_verwe = wa_recipe_h-verwe."wa_recipe_h-verwe.
lv_vagrp = wa_recipe_h-vagrp.
lv_bmsch = wa_recipe_h-bmsch.
lv_ktext = wa_recipe_h-ktext.
lv_plnme = wa_recipe_h-plnme.
lv_meinh = wa_recipe_h-meinh.
lv_maktx = wa_recipe_h-maktx.
lv_losbs = zif_d_constant=>c_losbs. "to lot size
lv_losvn = zif_d_constant=>c_losvn.
lv_phseq = zif_d_constant=>c_phseq.
IF wa_recipe_h-werks CP '10*' .
lv_prod_desc = wa_recipe_h-maktx.
ELSEIF wa_recipe_h-werks CP '20*'.
lv_prod_desc = wa_recipe_h-mpr_num.
ENDIF.
CLEAR wa_ctu_options.
wa_ctu_options-dismode = 'N'.
wa_ctu_options-updmode = 'S'.
wa_ctu_options-defsize = 'X'.
*-------------------------------------------------------------*
* FROM LOT SIZE AND TO LOT SIZE *
*-------------------------------------------------------------*
IF im_recipe_h-werks CP '10*'.
lv_bstmi = im_recipe_h-bmsch. "base quantity
lv_bstma = im_recipe_h-bmsch.
CONDENSE lv_bstma.
CONDENSE lv_bstmi.
ELSE.
lv_bstmi = '1'.
lv_bstma = zif_d_constant=>c_bstma.
CONDENSE lv_bstma.
CONDENSE lv_bstmi.
ENDIF.
*----------------------------------------------*
* VALIDATIONS *
*----------------------------------------------*
*-->Validate Material number AND Get Alt BOM
SELECT matnr
werks
stlan
stlal
stlnr FROM mast
INTO TABLE lit_mast
WHERE matnr = lv_matnr AND werks = lv_werks.
SORT lit_mast[] BY stlal DESCENDING.
READ TABLE lit_mast INTO wa_mast INDEX 1.
CLEAR lv_stlal.
IF wa_mast-stlnr IS NOT INITIAL.
lv_stlal = wa_mast-stlal.
lv_stlan = wa_mast-stlan.
ENDIF.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = lv_verid
IMPORTING
output = lv_verid.
REFRESH lit_bdcdata.
REFRESH lit_msgtab.
*&---------------------------------------------------------------------*
*& BDC Recording
*&---------------------------------------------------------------------*
* TCode : C201 - Create Master Recipe
*----------------------------------------------------------------------*
*-->INITIAL SCREEN
PERFORM bdc_dynpro USING 'SAPLCPDI' '4000'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RC271-PROFIDNETZ'.
PERFORM bdc_field USING 'PLKOD-PLNAL'
lv_plnnr.
PERFORM bdc_field USING 'PLKOD-PLNAL'
lv_plnal.
PERFORM bdc_field USING 'BDC_OKCODE'
'=TON'.
PERFORM bdc_field USING 'PLKOD-PLNAL'
' '."lv_plnnr'.
PERFORM bdc_field USING 'PLKOD-PLNAL'
' '. "lv_plnal.
PERFORM bdc_field USING 'RC27M-MATNR'
lv_matnr.
PERFORM bdc_field USING 'RC27M-WERKS'
lv_werks.
PERFORM bdc_field USING 'RC271-PROFIDNETZ'
'PI01'.
PERFORM bdc_field USING 'RC271-STTAG'
lv_date.
PERFORM bdc_field USING 'BDC_OKCODE'
'=TON'.
*-->SECOND SCREEN : Recipe Header
PERFORM bdc_dynpro USING 'SAPLC2CU' '0100'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'PLKOD-PLNAL'
' '.
PERFORM bdc_field USING 'PLKOD-KTEXT'
wa_recipe_h-maktx.
PERFORM bdc_field USING 'PLKOD-WERKS'
lv_werks.
PERFORM bdc_field USING 'BDC_CURSOR'
'PLKOD-VAGRP'.
PERFORM bdc_field USING 'PLKOD-STATU'
lv_stat.
PERFORM bdc_field USING 'PLKOD-VERWE'
lv_verwe.
PERFORM bdc_field USING 'PLKOD-VAGRP'
lv_vagrp.
CONDENSE lv_losbs.
PERFORM bdc_field USING 'PLKOD-LOSBS'
lv_losbs.
PERFORM bdc_field USING 'PLKOD-LOSVN'
lv_losvn.
PERFORM bdc_field USING 'PLKOD-PLNME'
lv_plnme.
PERFORM bdc_field USING 'PLKOD-MEINH'
lv_plnme.
gd_qty_tmp = lv_bmsch.
CONDENSE gd_qty_tmp.
PERFORM bdc_field USING 'PLKOD-BMSCH'
gd_qty_tmp.
*-----------------------------------------------------------*
*-----------------Operation Tab-----------------------*
*-----------------------------------------------------------*
CLEAR : gd_bsmch,
wa_recipe_i.
SORT im_recipe_i BY vornr ASCENDING.
DESCRIBE TABLE im_recipe_i LINES gd_opt1.
*---define no of rows for page down in operation tab------*
LOOP AT im_recipe_i INTO wa_recipe_i .
gd_opt1 = sy-tabix.
gd_opt = gd_opt + 1 .
IF sy-tabix > 10 .
IF gd_opt1 MOD 2 = 0.
PERFORM bdc_dynpro USING 'SAPLC2CU' '0100'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=P+'.
PERFORM bdc_field USING 'BDC_CURSOR'
'PLPOD-VORNR(01)'.
ELSE.
DO ( gd_opt1 - 1 ) DIV 10 TIMES .
PERFORM bdc_dynpro USING 'SAPLC2CU' '0100'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=P+'.
PERFORM bdc_field USING 'BDC_CURSOR'
'PLPOD-VORNR(01)'.
ENDDO.
ENDIF.
*-->Determine Page Down for Phases Selected.
IF wa_recipe_i-phflg EQ 'X'.
IF ( gd_opt1 MOD 10 ) = 0.
gd_opt = 02.
ELSE.
gd_opt = 02.
ENDIF.
ELSE.
IF lv_flg NE 'X'.
gd_opt = 02.
ELSE.
gd_opt = gd_opt1 MOD 10.
IF gd_opt = 1. " Incase of First Record of Every Page
gd_opt = 02.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
*--End of Page Down Determination
CONCATENATE 'PLPOD-PHFLG(' gd_opt ')' INTO gd_phflg.
CONDENSE gd_phflg.
PERFORM bdc_field USING gd_phflg
wa_recipe_i-phflg.
CLEAR gd_pvznr.
CONCATENATE 'PLPOD-PVZNR(' gd_opt ')' INTO gd_pvznr.
CONDENSE gd_pvznr.
PERFORM bdc_field USING gd_pvznr wa_recipe_i-pvznr. "Superordinate Operation
CLEAR gd_phseq.
CONCATENATE 'PLPOD-PHSEQ(' gd_opt ')' INTO gd_phseq.
CONDENSE gd_phseq.
PERFORM bdc_field USING gd_phseq wa_recipe_i-phseq. "Control Recipe Destination
CLEAR gd_vornr.
CONCATENATE 'PLPOD-VORNR(' gd_opt ')' INTO gd_vornr.
CONDENSE gd_vornr.
PERFORM bdc_field USING gd_vornr wa_recipe_i-vornr.
CLEAR gd_arbpl.
CONCATENATE 'PLPOD-ARBPL(' gd_opt ')' INTO gd_arbpl.
CONDENSE gd_arbpl.
PERFORM bdc_field USING gd_arbpl wa_recipe_i-arbpl. " Resource
CLEAR gd_steus.
CONCATENATE 'PLPOD-STEUS(' gd_opt ')' INTO gd_steus.
CONDENSE gd_steus.
PERFORM bdc_field USING gd_steus wa_recipe_i-steus. " Control key
CLEAR gd_ltxa1_p.
CONCATENATE 'PLPOD-LTXA1(' gd_opt ')' INTO gd_ltxa1_p.
CONDENSE gd_ltxa1_p.
PERFORM bdc_field USING gd_ltxa1_p wa_recipe_i-ltxa1. " Operation short text
CONCATENATE 'PLPOD-BMSCH(' gd_opt ')' INTO gd_bsmch. "Recipe Item Quantity
CONDENSE gd_bsmch.
CLEAR gd_qty_tmp.
gd_qty_tmp = wa_recipe_i-bmsch .
CONDENSE gd_qty_tmp.
PERFORM bdc_field USING gd_bsmch gd_qty_tmp.
CLEAR gd_meinh.
CONCATENATE 'PLPOD-MEINH(' gd_opt ')' INTO gd_meinh. "Item UOM
CONDENSE gd_meinh.
PERFORM bdc_field USING 'BDC_CURSOR' gd_meinh.
PERFORM bdc_field USING gd_meinh wa_recipe_i-meinh.
PERFORM bdc_dynpro USING 'SAPLC2CU' '0100'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
*------------------------------------------------------------------------*
** Get Standard value key based on resource *
* - Determine no of standard key values to be enabled *
*------------------------------------------------------------------------*
IF wa_recipe_i-phflg = 'X'.
DATA : lit_crhd TYPE TABLE OF crhd,
wa_crhd TYPE crhd.
SELECT SINGLE *
FROM crhd INTO wa_crhd WHERE arbpl = wa_recipe_i-arbpl
AND werks = im_recipe_h-werks.
IF wa_recipe_i-vgw01 IS NOT INITIAL.
CLEAR gd_vgw01.
CONCATENATE 'PLPOD-VGW01(' gd_opt ')' INTO gd_vgw01.
CONDENSE gd_vgw01.
CLEAR gd_qty_tmp.
gd_qty_tmp = wa_recipe_i-vgw01.
PERFORM bdc_field USING 'BDC_CURSOR'
gd_vgw01.
PERFORM bdc_field USING 'RC27X-ENTRY_ACT'
'1'.
gd_qty_tmp = wa_recipe_i-vgw01.
CONDENSE gd_qty_tmp.
PERFORM bdc_field USING gd_vgw01
gd_qty_tmp.
CLEAR gd_qty_tmp.
"Standard Key UOM
IF wa_crhd-vge01 IS NOT INITIAL.
CLEAR gd_vge.
CONCATENATE 'PLPOD-VGE01(' gd_opt ')' INTO gd_vge.
PERFORM bdc_field USING 'BDC_CURSOR'
gd_vge.
CALL FUNCTION 'CONVERSION_EXIT_CUNIT_OUTPUT'
EXPORTING
input = wa_crhd-vge01
language = sy-langu
IMPORTING
output = wa_crhd-vge01.
PERFORM bdc_field USING gd_vge
wa_crhd-vge01.
ENDIF.
ENDIF.
IF wa_recipe_i-vgw02 IS NOT INITIAL.
CLEAR gd_vgw02.
CONCATENATE 'PLPOD-VGW02(' gd_opt ')' INTO gd_vgw02.
CONDENSE gd_vgw02.
CLEAR gd_qty_tmp.
gd_qty_tmp = wa_recipe_i-vgw02.
CONDENSE gd_qty_tmp.
PERFORM bdc_field USING gd_vgw02
gd_qty_tmp.
IF wa_crhd-vge02 IS NOT INITIAL.
CLEAR gd_vge.
CONCATENATE 'PLPOD-VGE02(' gd_opt ')' INTO gd_vge.
PERFORM bdc_field USING 'BDC_CURSOR'
gd_vge.
CALL FUNCTION 'CONVERSION_EXIT_CUNIT_OUTPUT'
EXPORTING
input = wa_crhd-vge02
language = sy-langu
IMPORTING
output = wa_crhd-vge02.
PERFORM bdc_field USING gd_vge
wa_crhd-vge02.
ENDIF.
ENDIF.
IF wa_recipe_i-vgw03 IS NOT INITIAL.
CLEAR gd_vgw03.
CONCATENATE 'PLPOD-VGW03(' gd_opt ')' INTO gd_vgw03.
CONDENSE gd_vgw03.
CLEAR gd_qty_tmp.
gd_qty_tmp = wa_recipe_i-vgw03.
CONDENSE gd_qty_tmp.
PERFORM bdc_field USING gd_vgw03
gd_qty_tmp.
IF wa_crhd-vge03 IS NOT INITIAL.
CLEAR gd_vge.
CONCATENATE 'PLPOD-VGE03(' gd_opt ')' INTO gd_vge.
PERFORM bdc_field USING 'BDC_CURSOR'
gd_vge.
CALL FUNCTION 'CONVERSION_EXIT_CUNIT_OUTPUT'
EXPORTING
input = wa_crhd-vge03
language = sy-langu
IMPORTING
output = wa_crhd-vge03.
PERFORM bdc_field USING gd_vge
wa_crhd-vge03.
ENDIF.
ENDIF.
IF wa_recipe_i-vgw04 IS NOT INITIAL.
CLEAR gd_vgw04.
CONCATENATE 'PLPOD-VGW04(' gd_opt ')' INTO gd_vgw04.
CONDENSE gd_vgw04.
CLEAR gd_qty_tmp.
gd_qty_tmp = wa_recipe_i-vgw04.
CONDENSE gd_qty_tmp.
PERFORM bdc_field USING gd_vgw04
gd_qty_tmp.
"Standard Key UOM
IF wa_crhd IS NOT INITIAL.
CLEAR gd_vge.
CONCATENATE 'PLPOD-VGE04(' gd_opt ')' INTO gd_vge.
PERFORM bdc_field USING 'BDC_CURSOR'
gd_vge.
CALL FUNCTION 'CONVERSION_EXIT_CUNIT_OUTPUT'
EXPORTING
input = wa_crhd-vge04
language = sy-langu
IMPORTING
output = wa_crhd-vge04.
PERFORM bdc_field USING gd_vge
wa_crhd-vge04.
ENDIF.
ENDIF.
IF wa_recipe_i-vgw05 IS NOT INITIAL.
CLEAR gd_vgw05.
CONCATENATE 'PLPOD-VGW05(' gd_opt ')' INTO gd_vgw05.
CONDENSE gd_vgw05.
CLEAR gd_qty_tmp.
gd_qty_tmp = wa_recipe_i-vgw05.
CONDENSE gd_qty_tmp.
PERFORM bdc_field USING gd_vgw05
gd_qty_tmp .
"Standard Key UOM
IF wa_crhd-vge05 IS NOT INITIAL.
CLEAR gd_vge.
CONCATENATE 'PLPOD-VGE05(' gd_opt ')' INTO gd_vge.
PERFORM bdc_field USING 'BDC_CURSOR'
gd_vge.
CALL FUNCTION 'CONVERSION_EXIT_CUNIT_OUTPUT'
EXPORTING
input = wa_crhd-vge05
language = sy-langu
IMPORTING
output = wa_crhd-vge05.
PERFORM bdc_field USING gd_vge
wa_crhd-vge05.
ENDIF.
ENDIF.
IF wa_recipe_i-vgw06 IS NOT INITIAL.
CLEAR gd_vgw06.
CONCATENATE 'PLPOD-VGW06(' gd_opt ')' INTO gd_vgw06.
CONDENSE gd_vgw06.
CLEAR gd_qty_tmp.
gd_qty_tmp = wa_recipe_i-vgw06.
CONDENSE gd_qty_tmp.
PERFORM bdc_field USING gd_vgw06
gd_qty_tmp .
"Standard Key UOM
CLEAR gd_vge.
CONCATENATE 'PLPOD-VGE06(' gd_opt ')' INTO gd_vge.
PERFORM bdc_field USING 'BDC_CURSOR'
gd_vge.
CALL FUNCTION 'CONVERSION_EXIT_CUNIT_OUTPUT'
EXPORTING
input = wa_crhd-vge06
language = sy-langu
IMPORTING
output = wa_crhd-vge06.
IF wa_crhd-vge06 IS INITIAL .
wa_crhd-vge06 = 'H'. "Maintained if all Stnd keys are there 6th UOM is not filling
PERFORM bdc_field USING gd_vge
wa_crhd-vge06.
ENDIF.
ENDIF.
IF gd_opt1 > 10 .
IF wa_recipe_i-vgw01 IS NOT INITIAL OR
wa_recipe_i-vgw02 IS NOT INITIAL OR
wa_recipe_i-vgw03 IS NOT INITIAL OR
wa_recipe_i-vgw04 IS NOT INITIAL OR
wa_recipe_i-vgw05 IS NOT INITIAL OR
wa_recipe_i-vgw06 IS NOT INITIAL .
lv_flg = 'X'.
ELSE.
lv_flg = ' '.
ENDIF. " Set Flag Wether Standard Keys entered or Not
ENDIF.
ENDIF.
CLEAR : lv_index, wa_recipe_i.
ENDLOOP.
*---END OF SECTION 1-----------*
*----------------------------------------------------------------------*
** Charge QTY Formula - Only for 20*(FTO) Plants *
*----------------------------------------------------------------------*
Note : we can cross check the create BOM and Recipe using Tcode C223
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
11 | |
9 | |
5 | |
5 | |
4 | |
4 | |
4 | |
3 | |
3 | |
2 |