‎2010 May 10 11:26 PM
Hi All,
Can anyone let me know if there is a screen exit or a BADI where in i can use it to extend the COR1 general data tab to include a field.
Even if i can add a additional tab in COR1 tcode through a BADI, will be good.
Please help.
Thanks,
Jaffer Ali.S
‎2010 May 11 2:14 AM
Hi,
STEP1:- Add Z-Fiels in Structure CAUFVD & Table: AUFK using (Goto --> Append Structure)
Step1. T-code: CMOD
STEP2: Enter project name: Zxxxxx --> Create
STEP3: Enter Short text -- > Click Enhancement Assignment
STEP4: Enter Enhancement: PPCO0001 & PPCO0020
STEP5: Click on Components
STEP6.1: double click on Screen-Exit: SAPLCOKO (Screen no: 5900)
A) Add Z-fileds in SCreen layout with keyp of structure :CAUFVD
Screen FLOW LOGIC:-
Process before output.
PROCESS BEFORE OUTPUT.
Set the screen status
Screen modifications incase of Display
MODULE screen_display.
Process after input.
PROCESS AFTER INPUT.
Screen fields and its processing.
CHAIN.
FIELD: caufvd-z_cust1,
caufvd-z_cust2,
caufvd-z_cust3,
caufvd-z_cust4,
caufvd-z_cust5,
caufvd-z_qty1,
caufvd-z_qty2,
caufvd-z_qty3,
caufvd-z_qty4,
caufvd-z_qty5.
MODULE header_update.
ENDCHAIN.
FIELD: z_total.
MODULE disp_data.
Update the header.
Not required as of now.
-
module screen_display output.
Disable input in case of display.
if sy-tcode = 'COR3'.
loop at screen.
screen-input = 0.
modify screen.
endloop.
endif.
endmodule. " screen_display OUTPUT
module header_update input.
check not sy-tcode = 'COR3'.
perform data_check using caufvd.
endmodule. " HEADER_UPDATE INPUT
*Validate screen input fiels
form data_check using p_caufvd structure caufvd.
data: l_v_count type i.
get parameter id 'MAT' field p_caufvd-matnr.
if p_caufvd-z_cust1 is initial and p_caufvd-z_qty1 is initial and
p_caufvd-z_cust2 is initial and p_caufvd-z_qty2 is initial and
p_caufvd-z_cust3 is initial and p_caufvd-z_qty3 is initial and
p_caufvd-z_cust4 is initial and p_caufvd-z_qty4 is initial and
p_caufvd-z_cust5 is initial and p_caufvd-z_qty5 is initial.
else.
if not p_caufvd-z_cust1 is initial
and not p_caufvd-z_qty1 is initial.
select single count(*) into l_v_count from zcc_t01
where z_custmat = p_caufvd-z_cust1 and
matnr = p_caufvd-matnr.
if l_v_count < 1.
message e000(zpp) with 'Entered customer does not exist'.
endif.
clear l_v_count.
else.
message e000(zpp) with 'Fill both customer material and Qty'.
endif.
if not p_caufvd-z_cust2 is initial
and not p_caufvd-z_qty2 is initial.
select single count(*) into l_v_count from zcc_t01
where z_custmat = p_caufvd-z_cust2 and
matnr = p_caufvd-matnr.
if l_v_count < 1.
message e000(zpp) with 'Entered customer does not exist'.
endif.
clear l_v_count.
elseif
not ( p_caufvd-z_cust2 is initial and p_caufvd-z_qty2 is initial ).
message e000(zpp) with 'Fill both customer material and Qty'.
endif.
if not p_caufvd-z_cust3 is initial
and not p_caufvd-z_qty3 is initial.
select single count(*) into l_v_count from zcc_t01
where z_custmat = p_caufvd-z_cust3 and
matnr = p_caufvd-matnr.
if l_v_count < 1.
message e000(zpp) with 'Entered customer does not exist'.
endif.
clear l_v_count.
elseif
not ( p_caufvd-z_cust3 is initial and p_caufvd-z_qty3 is initial ).
message e000(zpp) with 'Fill both customer material and Qty'.
endif.
if not p_caufvd-z_cust4 is initial
and not p_caufvd-z_qty4 is initial.
select single count(*) into l_v_count from zcc_t01
where z_custmat = p_caufvd-z_cust4 and
matnr = p_caufvd-matnr.
if l_v_count < 1.
message e000(zpp) with 'Entered customer does not exist'.
endif.
clear l_v_count.
elseif
not ( p_caufvd-z_cust4 is initial and p_caufvd-z_qty4 is initial ).
message e000(zpp) with 'Fill both customer material and Qty'.
endif.
if not p_caufvd-z_cust5 is initial
and not p_caufvd-z_qty5 is initial.
select single count(*) into l_v_count from zcc_t01
where z_custmat = p_caufvd-z_cust5 and
matnr = p_caufvd-matnr.
if l_v_count < 1.
message e000(zpp) with 'Entered customer does not exist'.
endif.
clear l_v_count.
elseif
not ( p_caufvd-z_cust5 is initial and p_caufvd-z_qty5 is initial ).
message e000(zpp) with 'Fill both customer material and Qty'.
endif.
endif.
endform. " Data_check
***********************************************************************************************
STEP7:-Double click on Function Exit:EXIT_SAPLCOKO_005
Doouble click on include program: ZXCO1U21 and careae and add below code in include program
Data declarations
TYPES: BEGIN OF l_ty_zqty,
z_custmat TYPE zcc_t01-z_custmat,
z_qty TYPE zcc_t01-z_qty,
END OF l_ty_zqty.
DATA: l_s_zqty TYPE l_ty_zqty,
l_t_zqty LIKE STANDARD TABLE OF l_s_zqty,
l_v_frac TYPE zcc_t01-z_qty,
l_v_four TYPE f VALUE '0.4'.
SET PARAMETER ID 'MAT' FIELD i_caufvd-matnr.
Get the fields from ZCC_T01 and display it.
IF ( sy-tcode EQ 'COR1' OR sy-tcode EQ 'COR2' )
AND g_v_flag IS INITIAL.
IF i_caufvd-z_cust1 IS INITIAL AND
i_caufvd-z_cust2 IS INITIAL AND
i_caufvd-z_cust3 IS INITIAL AND
i_caufvd-z_cust4 IS INITIAL AND
i_caufvd-z_cust5 IS INITIAL.
SELECT z_custmat z_qty INTO TABLE l_t_zqty FROM zcc_t01
WHERE matnr = i_caufvd-matnr
AND z_qty NE space
AND z_qty NE '0'.
CHECK sy-subrc = 0.
LOOP AT l_t_zqty INTO l_s_zqty.
CASE sy-tabix.
WHEN 1.
caufvd-z_cust1 = l_s_zqty-z_custmat.
caufvd-z_qty1 = i_caufvd-gamng * l_s_zqty-z_qty / 100.
COMPUTE l_v_frac = FRAC( caufvd-z_qty1 ).
IF l_v_frac > l_v_four.
COMPUTE caufvd-z_qty1 = CEIL( caufvd-z_qty1 ).
ELSE.
COMPUTE caufvd-z_qty1 = FLOOR( caufvd-z_qty1 ).
ENDIF.
CLEAR l_v_frac.
WHEN 2.
caufvd-z_cust2 = l_s_zqty-z_custmat.
caufvd-z_qty2 = i_caufvd-gamng * l_s_zqty-z_qty / 100.
COMPUTE l_v_frac = FRAC( caufvd-z_qty2 ).
IF l_v_frac > l_v_four.
COMPUTE caufvd-z_qty2 = CEIL( caufvd-z_qty2 ).
ELSE.
COMPUTE caufvd-z_qty2 = FLOOR( caufvd-z_qty2 ).
ENDIF.
CLEAR l_v_frac.
WHEN 3.
caufvd-z_cust3 = l_s_zqty-z_custmat.
caufvd-z_qty3 = i_caufvd-gamng * l_s_zqty-z_qty / 100.
COMPUTE l_v_frac = FRAC( caufvd-z_qty3 ).
IF l_v_frac > l_v_four.
COMPUTE caufvd-z_qty3 = CEIL( caufvd-z_qty3 ).
ELSE.
COMPUTE caufvd-z_qty3 = FLOOR( caufvd-z_qty3 ).
ENDIF.
CLEAR l_v_frac.
WHEN 4.
caufvd-z_cust4 = l_s_zqty-z_custmat.
caufvd-z_qty4 = i_caufvd-gamng * l_s_zqty-z_qty / 100.
COMPUTE l_v_frac = FRAC( caufvd-z_qty4 ).
IF l_v_frac > l_v_four.
COMPUTE caufvd-z_qty4 = CEIL( caufvd-z_qty4 ).
ELSE.
COMPUTE caufvd-z_qty4 = FLOOR( caufvd-z_qty4 ).
ENDIF.
CLEAR l_v_frac.
WHEN 5.
caufvd-z_cust5 = l_s_zqty-z_custmat.
caufvd-z_qty5 = i_caufvd-gamng * l_s_zqty-z_qty / 100.
COMPUTE l_v_frac = FRAC( caufvd-z_qty5 ).
IF l_v_frac > l_v_four.
COMPUTE caufvd-z_qty5 = CEIL( caufvd-z_qty5 ).
ELSE.
COMPUTE caufvd-z_qty5 = FLOOR( caufvd-z_qty5 ).
ENDIF.
CLEAR l_v_frac.
WHEN OTHERS.
ENDCASE.
ENDLOOP.
g_v_flag = 'X'.
ENDIF.
IF g_v_flag IS INITIAL AND sy-tcode = 'COR2'.
MOVE-CORRESPONDING i_caufvd TO caufvd.
ENDIF.
ELSE.
MOVE-CORRESPONDING i_caufvd TO caufvd.
ENDIF.
STEP8:- Double click EXIT_SAPLCOKO_006
Doouble click on include program: ZXCO1U17 and careae and add below code in include program
*****************
Data Declaration.
tables : caufvd.
Export the fields.
move-corresponding caufvd to e_coci_aufk.
*******************************************************
hope this help...
Regards
Sudheer Madisetty
‎2011 Mar 22 6:40 PM
Hello,
Could you please explain in EXIT EXIT_SAPLCOKO_006 how did you get the structure caufvd ..in the above code move-corresponding caufvd to E_COCI_AUFK is not working. also which tables and structures needs to be appended with new fields.
Thanks,
Jaya.