Hi experts,
kindly check the following code.
when i click the first radio button it should take that date..When i click the seconde radio botton the data should come from the range of the dates. I have done this and not able to get proper data.
( radio buttons r6 & r7 ).
&----
*& Report Z_TEST *
*& *
&----
*& *
*& *
&----
report YSDPRICEREP no standard page heading
line-size 80 "M02
line-size 132
line-count 65
message-id Z1.
*-- Table Declaration
Tables : KONP, " Conditions (Item)
KONM, " Scale Record
MARA,
KNVV,
A004, " Material Cond
A005, " Cust Material Cond
A997, " All Cond
A055. " VTWEG, WERKS, VKORG Cond
M02 start
TABLES : KONH, " Conditions (Header)
A994, " Cust/Material @ cond typ PB01
A992. " Sorg/DC/Plant/Mat @ c typ YCOM
M02 end
*-- structure for KONP + COND Rec
types: begin of inforec,
vtweg like a004-vtweg,
kunnr like A005-kunnr, " Customer
matnr like mara-matnr, " Material
knumh like konh-knumh, " Cond rec #
kbetr like konp-kbetr, " Rate
konwa like konp-konwa, " Rate unit
kpein like konp-kpein, " Cond pricing unit
DATBI LIKe A996-DATBI, " Validity end date "M02
DATAB LIKE A996-dATAB, " Validity start date "M02
ERNAM LIKE KONH-ERNAM, " User ID "M02
vkorg like A997-vkorg, " SOrg "M02
werks like A997-werks, " Plant "M02
mfrpn like mara-mfrpn, "M03
erdat like konh-erdat, " Creation date "M04
end of inforec.
*-- Scale table structure
types : begin of ikonm,
kstbm like konm-kstbm, " Cond scale qty
kbetr like konm-kbetr, " Rate
end of ikonm.
*-- Working area
data : tmatnr like mara-matnr,
tkunnr like knvv-kunnr,
jpy_amt type p decimals 2,
tamt type p decimals 2,
i_inforec type inforec occurs 1 with header line,
i_konm type ikonm occurs 1 with header line,
s_flag. " scale output alignment indicator
parameters: pkschl like a004-kschl,
pvkorg like a004-vkorg default '3000',
pwerks like a055-werks.
SELECT-OPTIONS: svtweg for a004-vtweg,
skunnr for a005-kunnr,
smatnr for mara-matnr,
sprdha for mara-prdha.
parameters pvalid like sy-datum default sy-datum.
*M06....START
SELECTION-SCREEN BEGIN OF BLOCK test WITH FRAME TITLE TEXT-004.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(25) text-005.
PARAMETERS: r6 RADIOBUTTON GROUP xyz.
SELECTION-SCREEN POSITION 33.
PARAMETERS: Pdate TYPE d default sy-datum.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(25) text-006.
PARAMETERS: r7 RADIOBUTTON GROUP xyz.
SELECTION-SCREEN POSITION 30.
select-options prange for sy-datum.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK test.
*M06....END
*if r6 = 'x'.
*pvalid = pdate.
*elseif r7 = 'x'.
*free: pvalid,pdate.
*endif.
radio button grp for PR00 combinations
SELECTION-SCREEN BEGIN OF BLOCK BLOCK1 WITH FRAME TITLE TEXT-001.
PARAMETERS r4 RADIOBUTTON GROUP radi.
PARAMETERS r5 RADIOBUTTON GROUP radi.
SELECTION-SCREEN END OF BLOCK BLOCK1.
radio button grp for ZI02 combinations
SELECTION-SCREEN BEGIN OF BLOCK BLOCK2 WITH FRAME TITLE TEXT-002.
PARAMETERS r997 RADIOBUTTON GROUP rade.
PARAMETERS r55 RADIOBUTTON GROUP rade.
SELECTION-SCREEN END OF BLOCK BLOCK2.
SELECTION-SCREEN BEGIN OF BLOCK BLOCK3 WITH FRAME TITLE TEXT-003.
PARAMETERS cscale as checkbox.
SELECTION-SCREEN END OF BLOCK BLOCK3.
at selection-screen.
if pkschl = 'PR00'.
if ( pvkorg is initial ) or ( svtweg is initial ).
message E022.
endif.
elseif pkschl = 'ZI02'.
if ( pvkorg is initial ) or ( svtweg is initial ).
message E022.
endif.
elseif pkschl = 'PI01'.
if ( pvkorg is initial ) or ( pwerks is initial ).
message E170.
endif.
M02 start
elseif pkschl = 'YCOM'.
if ( pvkorg is initial ) or ( pwerks is initial ).
message E023.
endif.
elseif pkschl = 'PB01'.
if ( pvkorg is initial ) or ( svtweg is initial ).
message E022.
endif.
M02 end
else.
message E021.
endif.
if pvalid is initial.
message E024.
elseif prange is initial. "M06
message E024.
endif.
start-of-selection.
fill s_matnr with correct entries. 08072002 Zir
call function 'Z_FILL_MATNR_SELTAB'
TABLES
s_matnr = smatnr.
check smatnr-low ne 'None'. "Added by Bala @ M05
fill up select options with * if not input.
if smatnr is initial.
smatnr-sign = 'I'.
smatnr-option = 'CP'.
smatnr-low = '*'.
endif.
if skunnr is initial.
skunnr-sign = 'I'.
skunnr-option = 'CP'.
skunnr-low = '*'.
endif.
perform collect_data.
perform write_to_list.
&----
*& Form COLLECT_DATA
&----
FORM collect_data.
clear i_inforec.
refresh i_inforec.
PR00 with material
if ( pkschl = 'PR00' ) and ( r4 = 'X' ).
select vtweg matnr knumh "M02
select vtweg matnr knumh datbi datab "M02
into corresponding fields of i_inforec
from A004
where kappl eq 'V'
and kschl eq pkschl
and vkorg eq pvkorg
and vtweg in svtweg
and matnr in smatnr
and datbi ge pvalid
and datab le pvalid
and datab ge prange-low "M06
and datbi le prange-high. "M06
if sy-subrc = 0.
if filtered by product hierachy
if not ( sprdha is initial ).
select single mfrpn into i_inforec-mfrpn from mara
where prdha in sprdha
and matnr = i_inforec-matnr
and lvorm ne 'X'.
check sy-subrc eq 0.
else.
select single mfrpn into i_inforec-mfrpn from mara
where matnr = i_inforec-matnr
and lvorm ne 'X'.
check sy-subrc eq 0.
endif.
select single kbetr konwa kpein
into corresponding fields of i_inforec
from konp where knumh = i_inforec-knumh
and loevm_ko ne 'X'.
check sy-subrc eq 0.
if i_inforec-konwa = 'JPY'.
tamt = i_inforec-kbetr.
perform get_display_amount.
i_inforec-kbetr = jpy_amt.
endif.
append i_inforec.
clear i_inforec.
else.
clear i_inforec.
endif.
endselect.
PR00 with Cust/ Material
elseif ( pkschl = 'PR00' ) and ( r5 = 'X' ).
select vtweg kunnr matnr knumh "M02
select vtweg kunnr matnr knumh datbi datab "M02
into corresponding fields of i_inforec
from A005
where kappl eq 'V'
and kschl eq pkschl
and vkorg eq pvkorg
and vtweg in svtweg
and kunnr in skunnr
and matnr in smatnr
and datbi ge pvalid
and datab le pvalid
and datab ge prange-low "M06
and datbi le prange-high. "M06
if sy-subrc = 0.
filtered by product hierachy
if not ( sprdha is initial ).
select single mfrpn into i_inforec-mfrpn from mara
where prdha in sprdha
and matnr = i_inforec-matnr
and lvorm ne 'X'.
check sy-subrc eq 0.
else.
select single mfrpn into i_inforec-mfrpn from mara
where matnr = i_inforec-matnr
and lvorm ne 'X'.
check sy-subrc eq 0.
endif.
select single kunnr into tkunnr from knvv
where kunnr = i_inforec-kunnr
and loevm ne 'X'.
check sy-subrc eq 0.
select single kbetr konwa kpein
into corresponding fields of i_inforec
from konp where knumh = i_inforec-knumh
and loevm_ko ne 'X'.
check sy-subrc eq 0.
if i_inforec-konwa = 'JPY'.
tamt = i_inforec-kbetr.
perform get_display_amount.
i_inforec-kbetr = jpy_amt.
endif.
append i_inforec.
clear i_inforec.
else.
clear i_inforec.
endif.
endselect.
ZI02 with Plant only
elseif ( pkschl = 'ZI02' ) and ( r55 = 'X' ).
select matnr knumh "M02
select matnr knumh datbi datab "M02
into corresponding fields of i_inforec
from A055
where kappl eq 'V'
and kschl eq pkschl
and vkorgau eq pvkorg
and werks eq pwerks
and matnr in smatnr
and datbi ge pvalid
and datab le pvalid
and datab ge prange-low "M06
and datbi le prange-high. "M06
if sy-subrc = 0.
filtered by product hierachy
if not ( sprdha is initial ).
select single mfrpn into i_inforec-mfrpn from mara
where prdha in sprdha
and matnr = i_inforec-matnr
and lvorm ne 'X'.
check sy-subrc eq 0.
else.
select single mfrpn into i_inforec-mfrpn from mara
where matnr = i_inforec-matnr
and lvorm ne 'X'.
check sy-subrc eq 0.
endif.
select single kbetr konwa kpein
into corresponding fields of i_inforec
from konp where knumh = i_inforec-knumh
and loevm_ko ne 'X'.
check sy-subrc eq 0.
if i_inforec-konwa = 'JPY'.
tamt = i_inforec-kbetr.
perform get_display_amount.
i_inforec-kbetr = jpy_amt.
endif.
append i_inforec.
clear i_inforec.
else.
clear i_inforec.
endif.
endselect.
ZI02 with all
elseif ( pkschl = 'ZI02' ) and ( r997 = 'X' ).
select vtweg kunnr matnr knumh "M02
select vtweg kunnr matnr knumh datbi datab "M02
into corresponding fields of i_inforec
from A997 "M01
from A996 "M01
where kappl eq 'V'
and kschl eq pkschl
and vkorg eq pvkorg
and vtweg in svtweg
and werks eq pwerks "M01
and kunnr in skunnr
and matnr in smatnr
and datbi ge pvalid
and datab le pvalid
and datab ge prange-low "M06
and datbi le prange-high. "M06
if sy-subrc = 0.
filtered by product hierachy
if not ( sprdha is initial ).
select single mfrpn into i_inforec-mfrpn from mara
where prdha in sprdha
and matnr = i_inforec-matnr
and lvorm ne 'X'.
check sy-subrc eq 0.
else.
select single mfrpn into i_inforec-mfrpn from mara
where matnr = i_inforec-matnr
and lvorm ne 'X'.
check sy-subrc eq 0.
endif.
select single kunnr into tkunnr from knvv
where kunnr = i_inforec-kunnr
and loevm ne 'X'.
check sy-subrc eq 0.
select single kbetr konwa kpein
into corresponding fields of i_inforec
from konp where knumh = i_inforec-knumh
and loevm_ko ne 'X'.
check sy-subrc eq 0.
if i_inforec-konwa = 'JPY'.
tamt = i_inforec-kbetr.
perform get_display_amount.
i_inforec-kbetr = jpy_amt.
endif.
append i_inforec.
clear i_inforec.
else.
clear i_inforec.
endif.
endselect.
PI01 with Plant only
elseif ( pkschl = 'PI01' ).
select matnr knumh "M02
select matnr knumh datbi datab "M02
into corresponding fields of i_inforec
from A055
where kappl eq 'V'
and kschl eq pkschl
and vkorgau eq pvkorg
and werks eq pwerks
and matnr in smatnr
and datbi ge pvalid
and datab le pvalid
and datab ge prange-low "M06
and datbi le prange-high. "M06
if sy-subrc = 0.
filtered by product hierachy
if not ( sprdha is initial ).
select single mfrpn into i_inforec-mfrpn from mara
where prdha in sprdha
and matnr = i_inforec-matnr
and lvorm ne 'X'.
check sy-subrc eq 0.
else.
select single mfrpn into i_inforec-mfrpn from mara
where matnr = i_inforec-matnr
and lvorm ne 'X'.
check sy-subrc eq 0.
endif.
select single kbetr konwa kpein
into corresponding fields of i_inforec
from konp where knumh = i_inforec-knumh
and loevm_ko ne 'X'.
check sy-subrc eq 0.
if i_inforec-konwa = 'JPY'.
tamt = i_inforec-kbetr.
perform get_display_amount.
i_inforec-kbetr = jpy_amt.
endif.
append i_inforec.
clear i_inforec.
else.
clear i_inforec.
endif.
endselect.
endif.
M02 start
PB01 with Cust/ Material
if ( pkschl = 'PB01' ).
Insert by Cindy: To segregate PB01 by DC, since Price Master not
maintained by DC. Check Customer master for info
select distinct A994kunnr A994matnr A994knumh A994datbi
A994~datab into corresponding fields of i_inforec
from A994 as A994 inner join knvv as knvv
on A994kunnr = knvvkunnr
where kappl eq 'V'
and kschl eq pkschl
and A994~kunnr in skunnr
and knvv~vtweg in svtweg
and knvv~loevm ne 'X'
and A994~matnr in smatnr
and A994~datbi ge pvalid
and A994~datab le pvalid
and A994~datab ge prange-low "M06
and A994~datbi le prange-high. "M06
commented by Cindy
*select kunnr matnr knumh datbi datab
into corresponding fields of i_inforec
from A994
where kappl eq 'V'
and kschl eq pkschl
and kunnr in skunnr
and matnr in smatnr
and datbi ge pvalid
and datab le pvalid.
end
if sy-subrc = 0.
filtered by product hierachy
if not ( sprdha is initial ).
select single mfrpn into i_inforec-mfrpn from mara
where prdha in sprdha
and matnr = i_inforec-matnr
and lvorm ne 'X'."M03
check sy-subrc eq 0.
else.
select single mfrpn into i_inforec-mfrpn from mara
where matnr = i_inforec-matnr
and lvorm ne 'X'."M03
check sy-subrc eq 0.
endif.
select single kunnr into tkunnr from knvv
where kunnr = i_inforec-kunnr
and loevm ne 'X'.
check sy-subrc eq 0.
select single kbetr konwa kpein
into corresponding fields of i_inforec
from konp where knumh = i_inforec-knumh
and loevm_ko ne 'X'.
check sy-subrc eq 0.
if i_inforec-konwa = 'JPY'.
tamt = i_inforec-kbetr.
perform get_display_amount.
i_inforec-kbetr = jpy_amt.
endif.
append i_inforec.
clear i_inforec.
else.
clear i_inforec.
endif.
endselect.
endif.
YCOM with SOrg/DC/Plant/Mat
if ( pkschl = 'YCOM' ) and ( r4 = 'X' ).
select vtweg matnr knumh datbi datab vkorg werks
into corresponding fields of i_inforec
from A992
where kappl eq 'V'
and kschl eq pkschl
and vkorg eq pvkorg
and vtweg in svtweg
and werks eq pwerks
and matnr in smatnr
and datbi ge pvalid
and datab le pvalid
and datab ge prange-low "M06
and datbi le prange-high. "M06
if sy-subrc = 0.
if filtered by product hierachy
if not ( sprdha is initial ).
select single mfrpn into i_inforec-mfrpn from mara
where prdha in sprdha
and matnr = i_inforec-matnr
and lvorm ne 'X'."M03
check sy-subrc eq 0.
else.
select single mfrpn into i_inforec-mfrpn from mara
where matnr = i_inforec-matnr
and lvorm ne 'X'."M03
check sy-subrc eq 0.
endif.
select single kbetr konwa kpein
into corresponding fields of i_inforec
from konp where knumh = i_inforec-knumh
and loevm_ko ne 'X'.
check sy-subrc eq 0.
if i_inforec-konwa = 'JPY'.
tamt = i_inforec-kbetr.
perform get_display_amount.
i_inforec-kbetr = jpy_amt.
endif.
i_inforec-kbetr = i_inforec-kbetr / 10. "M03
append i_inforec.
clear i_inforec.
else.
clear i_inforec.
endif.
endselect.
endif.
YCOM with SOrg/DC/Plant/Cust/Mat
if ( pkschl = 'YCOM' ) and ( r5 = 'X' ).
select vtweg kunnr matnr knumh datbi datab vkorg werks
into corresponding fields of i_inforec
from A997
where kappl eq 'V'
and kschl eq pkschl
and vkorg eq pvkorg
and vtweg in svtweg
and werks eq pwerks
and kunnr in skunnr
and matnr in smatnr
and datbi ge pvalid
and datab le pvalid
and datab ge prange-low "M06
and datbi le prange-high. "M06
if sy-subrc = 0.
filtered by product hierachy
if not ( sprdha is initial ).
select single mfrpn into i_inforec-mfrpn from mara
where prdha in sprdha
and matnr = i_inforec-matnr
and lvorm ne 'X'.
check sy-subrc eq 0.
else.
select single mfrpn into i_inforec-mfrpn from mara
where matnr = i_inforec-matnr
and lvorm ne 'X'.
check sy-subrc eq 0.
endif.
select single kunnr into tkunnr from knvv
where kunnr = i_inforec-kunnr
and loevm ne 'X'.
check sy-subrc eq 0.
select single kbetr konwa kpein
into corresponding fields of i_inforec
from konp where knumh = i_inforec-knumh
and loevm_ko ne 'X'.
check sy-subrc eq 0.
if i_inforec-konwa = 'JPY'.
tamt = i_inforec-kbetr.
perform get_display_amount.
i_inforec-kbetr = jpy_amt.
endif.
i_inforec-kbetr = i_inforec-kbetr / 10. "M03
append i_inforec.
clear i_inforec.
else.
clear i_inforec.
endif.
endselect.
endif.
M02 end
read table i_inforec.
if sy-tfill eq 0.
message I016.
endif.
ENDFORM. " F_GET_KONH_KONP
&----
*& Form CHECK_SCALES
&----
FORM check_scales.
clear: i_konm.
refresh: i_konm.
select kstbm
kbetr
appending corresponding fields of table i_konm
from konm
where knumh = i_inforec-knumh.
check sy-subrc = 0.
depending on scale output ind. diff alignment
if s_flag = 2.
write: /29(32) SY-ULINE.
write: /29 'SCALE QUANTITY', 57 'RATE'.
write: /29(32) SY-ULINE.
loop at i_konm.
write: /25 i_konm-kstbm, 46 i_konm-kbetr.
endloop.
write: /29(32) SY-ULINE.
else.
write: /19(32) SY-ULINE.
write: /19 'SCALE QUANTITY', 47 'RATE'.
write: /19(32) SY-ULINE.
loop at i_konm.
write: /15 i_konm-kstbm, 36 i_konm-kbetr.
endloop.
write: /19(32) SY-ULINE.
endif.
skip.
ENDFORM. " F_GET_KONM
&----
*& Form WRITE_TO_LIST
&----
FORM WRITE_TO_LIST.
sorting based on customer & dist.channel or dist. channel based on
earlier selections
if ( ( pkschl = 'PR00' ) and ( r4 = 'X' ) ) or
( ( pkschl = 'ZI02' ) and ( r55 = 'X' ) ) or
( pkschl = 'PI01' ).
sort i_inforec by vtweg mfrpn . "matnr.
elseif ( ( pkschl = 'PR00' ) and ( r5 = 'X' ) ) or
( ( pkschl = 'ZI02' ) and ( r997 = 'X' ) ).
sort i_inforec by kunnr vtweg mfrpn ."matnr.
endif.
M02 start
if pkschl = 'YCOM' and r4 = 'X'.
sort i_inforec by vtweg mfrpn . "matnr.
elseif pkschl = 'YCOM' and r5 = 'X'.
sort i_inforec by kunnr vtweg mfrpn ."matnr.
endif.
if pkschl = 'PB01'.
sort i_inforec by kunnr mfrpn . "matnr.
endif.
M02 end
loop at i_inforec.
**M02 start
if pvkorg is initial.
if pwerks is initial.
else.
check i_inforec-werks eq pwerks.
endif.
else.
if pwerks is initial.
check i_inforec-vkorg eq pvkorg.
check i_inforec-werks eq pwerks.
else.
check i_inforec-vkorg eq pvkorg.
check i_inforec-werks eq pwerks.
endif.
endif.
select single ernam erdat into corresponding
fields of i_inforec from konh
where knumh = i_inforec-knumh.
**M02 end
clear s_flag.
if ( pkschl = 'PR00' ) and ( r4 = 'X' ). "M02
if ( pkschl = 'PR00' or pkschl = 'YCOM' ) and ( r4 = 'X' )."M02
perform write_no_cust.
elseif ( pkschl = 'PR00' ) and ( r5 = 'X' ). "M02
elseif ( pkschl = 'PR00' or pkschl = 'YCOM' ) and ( r5 = 'X' )."M02
perform write_w_cust.
s_flag = 2.
elseif ( pkschl = 'ZI02' ) and ( r55 = 'X' ).
perform write_no_cust.
elseif ( pkschl = 'ZI02' ) and ( r997 = 'X' ).
perform write_w_cust.
s_flag = 2.
elseif ( pkschl = 'PI01' ).
perform write_no_cust.
endif.
M02 start
if pkschl = 'PB01'.
perform write_w_cust.
s_flag = 2.
endif.
M02 end
if cscale = 'X'.
perform check_scales.
endif.
endloop.
ENDFORM. " OUTPUT
&----
*& Form WRITE_NO_CUST
&----
FORM WRITE_NO_CUST.
group by dist.channel
on change of i_inforec-vtweg.
if sy-tabix ne 1.
skip. skip.
endif.
write : /1 i_inforec-vtweg.
endon.
if pkschl ne 'YCOM'. "M02
write: /10 i_inforec-matnr, 36 i_inforec-kbetr, 54 i_inforec-konwa.
write: 62 i_inforec-kpein.
write: 70 i_inforec-DATAB, '-', i_inforec-DATBI. "M02
write: 96 i_inforec-ernam, 107 i_inforec-erdat. "M02
M02 start
else.
write: /10 i_inforec-matnr, 36 i_inforec-kbetr, 54 i_inforec-konwa.
write: 60 i_inforec-DATAB, '-', i_inforec-DATBI.
write: 87 i_inforec-ernam, 98 i_inforec-erdat.
endif.
M02 end
ENDFORM. " WRITE_NO_CUST
&----
*& Form WRITE_W_CUST
&----
FORM WRITE_W_CUST.
group by customer
on change of i_inforec-kunnr.
if sy-tabix ne 1.
skip. skip.
endif.
write : /1 i_inforec-kunnr, 12 i_inforec-vtweg.
endon.
if pkschl ne 'PB01'. "M02
if pkschl ne 'YCOM'. "M02
write: /20 i_inforec-matnr, 46 i_inforec-kbetr.
write: 64 i_inforec-konwa, 72 i_inforec-kpein.
write: 80 i_inforec-DATAB, '-', i_inforec-DATBI. "M02
write: 106 i_inforec-ernam, 117 i_inforec-erdat. "M02
M02 start
else.
write: /20 i_inforec-matnr, 46 i_inforec-kbetr.
write: 64 i_inforec-konwa.
write: 70 i_inforec-DATAB, '-', i_inforec-DATBI.
write: 98 i_inforec-ernam, 109 i_inforec-erdat.
endif.
else.
write: /12 i_inforec-matnr, 38 i_inforec-kbetr.
write: 56 i_inforec-konwa, 64 i_inforec-kpein.
write: 72 i_inforec-DATAB, '-', i_inforec-DATBI.
write: 98 i_inforec-ernam, 109 i_inforec-erdat.
endif.
M02 end
ENDFORM. " WRITE_W_CUST
TOP-OF-PAGE.
M02 start
call function 'Z_REPORT_TITLE'
EXPORTING
line_size = sy-linsz
sy_title = sy-title
uline = 'X'
first_page_only = ' '.
M02 end
WRITE: / 'Valid on: ', pvalid.
WRITE: / 'Valid on: ', prange-low, ' - ', prange-high. "M06
write: /1 'Condition type:', pkschl.
M02 start
if pkschl ne 'PB01'.
if pkschl = 'YCOM'.
if not ( pvkorg is initial ).
write: 25 'Sales Org:', pvkorg.
if not ( pwerks is initial ).
write: ' Plant:', pwerks.
endif.
else.
if not ( pwerks is initial ).
write: 25 'Plant:', pwerks.
endif.
endif.
else.
M02 end
write: 25 'Sales Org:', pvkorg.
write: 45 'Dist.Channel:', svtweg-low.
endif. "M02
else.
write: 25 'Sales Org:', pvkorg.
write: 45 'Dist.Channel:', svtweg-low.
endif. "M02
if pkschl ne 'YCOM'. "M02
if not ( pwerks is initial ).
write: ' Plant:', pwerks.
endif.
endif. "M02
skip.
if ( ( pkschl = 'PR00' ) and ( r4 = 'X' ) ) or
( ( pkschl = 'ZI02' ) and ( r55 = 'X' ) ) or
( pkschl = 'PI01' ).
data extraction from A055 has no dist. chan or customer
if ( pkschl = 'PR00' ) and ( r4 = 'X' ).
write: /1 'DIST.C'.
endif.
write: 10 'MATERIAL', 46 'PRICE'.
write: 53 'CURR', 62 'UNIT'.
write: 70 'VALID FROM', 83 'VALID TO'. "M02
write: 94 'CREATED BY', 107 'CREATE DATE'. "M02
elseif ( ( pkschl = 'PR00' ) and ( r5 = 'X' ) ) or
( ( pkschl = 'ZI02' ) and ( r997 = 'X' ) ).
write: /1 'CUSTOMER', 12 'DIST.C', 20 'MATERIAL'.
write: 56 'PRICE', 63 'CURR', 72 'UNIT'.
write: 80 'VALID FROM', 93 'VALID TO'. "M02
write: 104 'CREATED BY',117 'CREATE DATE'. "M02
endif.
M02 start
if pkschl = 'YCOM' and r4 = 'X'.
write: /1 'DIST.C'.
write: 10 'MATERIAL', 46 'COMM PERC'.
write: 60 'VALID FROM', 73 'VALID TO'.
write: 85 'CREATED BY', 98 'CREATE DATE'.
elseif pkschl = 'YCOM' and r5 = 'X'.
write: /1 'CUSTOMER', 12 'DIST.C', 20 'MATERIAL'.
write: 56 'COMM PERC'.
write: 70 'VALID FROM', 83 'VALID TO'.
write: 96 'CREATED BY', 109 'CREATE DATE'.
endif.
if pkschl = 'PB01'.
write: /1 'CUSTOMER', 12 'MATERIAL'.
write: 48 'PRICE', 55 'CURR', 64 'UNIT'.
write: 72 'VALID FROM', 85 'VALID TO'.
write: 96 'CREATED BY', 109 'CREATE DATE'.
endif.
M02 end
*write /0(90) SY-ULINE. "M02
write /0(132) SY-ULINE. "M02
----
FORM GET_DISPLAY_AMOUNT *
----
form get_display_amount.
CALL FUNCTION 'CURRENCY_AMOUNT_SAP_TO_DISPLAY'
EXPORTING
CURRENCY = i_inforec-konwa
AMOUNT_INTERNAL = tamt
IMPORTING
AMOUNT_DISPLAY = jpy_amt.
EXCEPTIONS
INTERNAL_ERROR = 1
OTHERS = 2.
endform.