2007 Mar 11 9:11 PM
Hi,
Can you pls give me solution for the below problem. I am new to this field.
I am using table <b>VBAK</b> and internal table <b>i_vbak</b>.
<b>Select</b>: VBELN, ERDAT, NETWR, VTWEG, SPART, KUNNR, KOSTL AUART, PS_PSP_PNR.
<b>Select-options</b>: VBELN, KUNNR, ERDAT.
I need to do following task:
1.Use AT USER-COMMAND
2.Use HIDE statement after write statement
3.Use GUI Status and add Button DISP - Display Sales Order
4.Call Transaction VA03 to display Sales Order when a valid line is highlighted and DISP button is clicked
5.Display Error Message to select a Valid line when other lines are selected
AT LINE SELECTION to display the row, column and screen number when a line is double-clicked.
I was able to make basic list. But I couldnt make the interactive list. And one more problem I am having is that I have total 7 fields to display but I could make seven heading for that. I can successfully adjust 6. Can you suggest something for that also pls.
If you want I can show my code for basic report list.
<b>Thanks in advance.</b>
2007 Mar 12 6:01 AM
Try copying the below program
and create two GUI status with name 'PURCHASEMENU' and 'PURCHASEMENU1' .. and there you are with the solution....
Assign the points if solved your probelm
&----
*& Report Z4SANINTERACTIVE
*&
&----
*&
*&
&----
REPORT Z4SANINTERACTIVE no standard page heading message-id z4.
tables: ekko, ekpo, konv, makt, T001, lfa1 .
selection-screen begin of block b1.
parameters: v_CCode like ekko-bukrs memory id BUK obligatory.
select-options: v_PDate for ekko-bedat,
v_POrg for ekko-Ekorg memory id EKO,
v_PONum for ekko-Ebeln memory id BES.
selection-screen end of block b1.
data: v_CheckBx.
data: v_counter type i. " variable to check how much time program has readline from the output list.
data: v_TotalVal like ekpo-netwr. " to sum total value in local currency
data: v_date(10).
data: v_CBValue type konv-kawrt.
data: v_CValue type konv-kwert.
data: begin of it_POdata occurs 0, " This table stores all the Purchase Order in the selected Range
Bukrs like ekko-Bukrs, " Company Code
Ebeln like ekko-Ebeln, " Purchase Order Number
Bedat like ekko-bedat, " Posting Date
Ekorg like ekko-Ekorg, " Purchasing Organization
Bsart like ekko-Bsart, " Doc Type
Lifnr like ekko-Lifnr, " Vendor Number.
knumv like ekko-knumv, " Number of Document Condition " This is the Common field between Ekko and konv(Condition Document)
end of it_POdata.
data: it_POdata1 like it_POdata occurs 0 with header line. " This Table is used to Store the Secondary List as the First internal
table is used to retrieve purchase order number including knumv
data: begin of it_TotalVal occurs 0, " Table used to store all the selected purchase order and calculate
Ebeln like ekpo-Ebeln, " Purchase Order Number " Total Value in Currency.
ebelp like ekpo-ebelp, " Item no.
netwr like ekpo-netwr, " Net Order Value.
end of it_TotalVal.
data: Begin of it_PODetail occurs 0, " Table used to store Purchase order detail used in Final list display
Ebeln like ekpo-Ebeln, " Purchase Order Number.
Ebelp like ekpo-ebelp, " Item Number,
matnr like ekpo-matnr, " Material Number
menge like ekpo-menge, " Quantity
meins like ekpo-meins, " Unit of Measurement
end of it_PODetail.
data: begin of it_DocumentDetail occurs 0, " This Table is used to Retrieve the information with Reference to
knumv like konv-knumv, " Number of Document Condition " P/O and knumv used in Final List
kposn like konv-kposn, " Condition Item Number
kschl like konv-kschl, " Condition type
kbetr like konv-kbetr, " Rate(Amount or Percentage)
kwert like konv-kwert, " Condition Value
kawrt like konv-kawrt, " Condition Base Value
end of it_DocumentDetail.
at selection-screen.
perform validate_CompCode. " This Function Validates Company Code if it Exist in its Master File.
start-of-selection.
set pf-status 'PURCHASEMENU'. " This Menu Displays The Execute Button.
perform Pouplate_it_POdata. " This Function Populates all the P/O Selected in range.
perform display_BasicList. " This Display Basic List including Check Boxes.
*at selection-screen output.
*get parameter id 'BUK' field v_CCode.
*
AT LINE-SELECTION. " This Event is Trigerred at Final list selection as only case 2 is handled.
CASE SY-LSIND.
WHEN 2.
perform display_FinalHeader. " This will display the header info
perform display_FinalData. " This uses it_DocumentDetail table to display Final List
ENDCASE.
AT USER-COMMAND.
CASE SY-UCOMM.
WHEN 'EXT1'.
SET SCREEN 0.
LEAVE SCREEN.
WHEN 'EXE1'.
CASE SY-LSIND.
WHEN 1.
set pf-status 'PURCHASEMENU1'.
refresh it_POdata1. " This Store all the Selected Purchase Order
do v_counter times.
read line sy-index field value v_checkBx it_POdata-Ebeln it_POdata-lifnr it_POdata-Bsart v_Date. "it_POdata-bedat.
if sy-subrc <> 0.
exit.
endif.
if v_checkBx = 'X'.
it_POdata1-Ebeln = it_POdata-Ebeln.
it_POdata1-lifnr = it_POdata-lifnr.
it_POdata1-Bsart = it_POdata-Bsart.
it_POdata1-bedat = v_date. "it_POdata-bedat.
append it_POdata1.
endif.
enddo.
sort it_POdata1.
select Ebeln ebelp netwr from ekpo into table it_TotalVal " This will Store all the net price for all the item
for all Entries in it_POdata1 " including the p/o number to sum up later on.
Where Ebeln = it_POdata1-Ebeln.
sort it_TotalVal.
perform display_SecondaryList. " This will display selected purchase order including Total Value in Local Currency
ENDCASE.
ENDCASE.
top-of-page.
perform display_Header.
********************************************************************************************************************************************
Function are Written here
form validate_CompCode .
select single * from T001 where Bukrs = v_CCode.
if sy-subrc <> 0.
message e046.
endif.
endform. " validate_CompCode
form display_Header .
Write:/ 'RAPIDIGM(INDIA) LTD',50 'LIST OF PO PRICING',70 'DATE',78 sy-datum.
if sy-lsind = 1.
Write:/50 'SECONDARY LIST', 70 'PAGE: ',78 sy-pagno.
else.
Write:/50 'BASIC LIST ', 70 'Page: ',78 sy-pagno.
Write:/ 'Display Basic List for Purchase Order'.
Write:/ 'Developer : Sanjay Yesi'.
endif.
uline.
endform. " display_Header
form Pouplate_it_POdata .
select MBukrs MEbeln MBsart MBedat Mekorg Mlifnr M~knumv into corresponding fields of table it_POdata from ekko as M
where MBukrs = v_CCode and Mekorg in v_POrg and MBedat in v_PDate and MEbeln in v_PONum.
endform. " Pouplate_it_POdata
form display_BasicList .
Write:/ 'Check', 15 'P/O NUM', 35 'POSTING', 50 'PO ORG ',60 'DOC',75 'VENDOR NO/'.
WRITE:/35 'DATE',60 'TYPE',75 'NAME'.
Write:/.
v_counter = 8.
LOOP AT IT_PODATA.
add 1 to v_counter.
perform get_VendorName.
v_Date = it_POdata-Bedat.
Write:/ v_CheckBx as checkbox,15 IT_PODATA-ebeln,35 IT_PODATA-Bedat,50 IT_PODATA-Ekorg, 60 IT_PODATA-Bsart,
75 IT_PODATA-lifnr, lfa1-name1.
ENDLOOP.
endform. " display_BasicList
form display_SecondaryList .
PERFORM display_Header.
Write:/ 'P/O NUM', 20 'VENDOR CODE', 60 'PO',70 'PO DATE',90 'TOTAL VALUE IN'.
WRITE:/20 'NAME',60 'TYPE',90 'LOCAL CURRENCY'.
Write:/.
LOOP AT it_POdata1.
read table it_POdata with key Ebeln = it_POdata1-Ebeln. " Used Just to Print Date Properly
perform get_VendorName.
perform get_TotalVal.
Write:/ it_POdata1-Ebeln,20 it_POdata1-lifnr,lfa1-name1,60 it_POdata1-Bsart,70 it_POdata-bedat,90 v_TotalVal.
HIDE: it_POdata1-Ebeln , it_POdata-BEDAT.
endloop.
endform. " display_SecondaryList
form get_VendorName .
select single * from lfa1 where lifnr = IT_PODATA1-lifnr.
endform. " get_VendorName
form get_TotalVal .
v_TotalVal = 0.
loop at it_TotalVal where Ebeln = it_POdata1-Ebeln.
v_TotalVal = v_TotalVal + it_TotalVal-netwr.
endloop.
endform. " get_TotalVal
FORM display_FinalHeader .
Write:/ 'PRICING DETAILS OF PURCHASE ORDER NUMBER:',50 it_POdata1-Ebeln.
Write:/ 'POSTING DATE:',20 IT_PODATA-BEDAT.
ULINE.
WRITE:/2 'ITEM NO',15 'MATERIAL',40 'QTY',55 'UOM',65'<--
>'.
WRITE:/65 'Type',83 'Rate',100 'Base',117 'Condition'.
Write:/100 'Value',117 'Value'.
uline.
ENDFORM. " display_FinalHeader
FORM display_FinalData .
sort it_POdata.
read table it_POdata with key Ebeln = it_POdata1-ebeln.
Populate Purchase Order detail for Item Number and Material Number.
select Ebeln ebelp matnr menge meins into corresponding fields of table it_PODetail from ekpo where ebeln = it_POdata1-ebeln.
Populate Document detail table with respect to Purchase Order Master
select knumv kposn kschl kbetr kwert kawrt into corresponding fields of table it_DocumentDetail from konv
where knumv = it_POdata-knumv.
sort it_PODetail.
sort it_DocumentDetail.
loop at it_PODetail. " Based on how many Items are there in Detail File
Write:/2 it_PODetail-Ebelp,15 it_PODetail-matnr,32 it_PODetail-menge,55 it_PODetail-meins.
loop at it_DocumentDetail where kposn = it_PODetail-Ebelp . " Many conditions are there per Item
Write: 65 it_DocumentDetail-kschl,75 it_DocumentDetail-kbetr,90 it_DocumentDetail-kawrt,
110 it_DocumentDetail-kwert.
Write:/.
v_CBValue = v_CBValue + it_DocumentDetail-kawrt.
v_CValue = v_CValue + it_DocumentDetail-kwert.
endloop.
uline at 65(62).
Write:/75 'Item Total',90 v_CBValue, 110 v_CValue.
uline.
v_CBValue = 0. v_CValue = 0.
endloop.
ENDFORM. " display_FinalData
Try copying the below program
and create two GUI status with name 'PURCHASEMENU' and 'PURCHASEMENU1' .. and there you are with the solution....
Assign the points if solved your probelm
&----
*& Report Z4SANINTERACTIVE
*&
&----
*&
*&
&----
REPORT Z4SANINTERACTIVE no standard page heading message-id z4.
tables: ekko, ekpo, konv, makt, T001, lfa1 .
selection-screen begin of block b1.
parameters: v_CCode like ekko-bukrs memory id BUK obligatory.
select-options: v_PDate for ekko-bedat,
v_POrg for ekko-Ekorg memory id EKO,
v_PONum for ekko-Ebeln memory id BES.
selection-screen end of block b1.
data: v_CheckBx.
data: v_counter type i. " variable to check how much time program has readline from the output list.
data: v_TotalVal like ekpo-netwr. " to sum total value in local currency
data: v_date(10).
data: v_CBValue type konv-kawrt.
data: v_CValue type konv-kwert.
data: begin of it_POdata occurs 0, " This table stores all the Purchase Order in the selected Range
Bukrs like ekko-Bukrs, " Company Code
Ebeln like ekko-Ebeln, " Purchase Order Number
Bedat like ekko-bedat, " Posting Date
Ekorg like ekko-Ekorg, " Purchasing Organization
Bsart like ekko-Bsart, " Doc Type
Lifnr like ekko-Lifnr, " Vendor Number.
knumv like ekko-knumv, " Number of Document Condition " This is the Common field between Ekko and konv(Condition Document)
end of it_POdata.
data: it_POdata1 like it_POdata occurs 0 with header line. " This Table is used to Store the Secondary List as the First internal
table is used to retrieve purchase order number including knumv
data: begin of it_TotalVal occurs 0, " Table used to store all the selected purchase order and calculate
Ebeln like ekpo-Ebeln, " Purchase Order Number " Total Value in Currency.
ebelp like ekpo-ebelp, " Item no.
netwr like ekpo-netwr, " Net Order Value.
end of it_TotalVal.
data: Begin of it_PODetail occurs 0, " Table used to store Purchase order detail used in Final list display
Ebeln like ekpo-Ebeln, " Purchase Order Number.
Ebelp like ekpo-ebelp, " Item Number,
matnr like ekpo-matnr, " Material Number
menge like ekpo-menge, " Quantity
meins like ekpo-meins, " Unit of Measurement
end of it_PODetail.
data: begin of it_DocumentDetail occurs 0, " This Table is used to Retrieve the information with Reference to
knumv like konv-knumv, " Number of Document Condition " P/O and knumv used in Final List
kposn like konv-kposn, " Condition Item Number
kschl like konv-kschl, " Condition type
kbetr like konv-kbetr, " Rate(Amount or Percentage)
kwert like konv-kwert, " Condition Value
kawrt like konv-kawrt, " Condition Base Value
end of it_DocumentDetail.
at selection-screen.
perform validate_CompCode. " This Function Validates Company Code if it Exist in its Master File.
start-of-selection.
set pf-status 'PURCHASEMENU'. " This Menu Displays The Execute Button.
perform Pouplate_it_POdata. " This Function Populates all the P/O Selected in range.
perform display_BasicList. " This Display Basic List including Check Boxes.
*at selection-screen output.
*get parameter id 'BUK' field v_CCode.
*
AT LINE-SELECTION. " This Event is Trigerred at Final list selection as only case 2 is handled.
CASE SY-LSIND.
WHEN 2.
perform display_FinalHeader. " This will display the header info
perform display_FinalData. " This uses it_DocumentDetail table to display Final List
ENDCASE.
AT USER-COMMAND.
CASE SY-UCOMM.
WHEN 'EXT1'.
SET SCREEN 0.
LEAVE SCREEN.
WHEN 'EXE1'.
CASE SY-LSIND.
WHEN 1.
set pf-status 'PURCHASEMENU1'.
refresh it_POdata1. " This Store all the Selected Purchase Order
do v_counter times.
read line sy-index field value v_checkBx it_POdata-Ebeln it_POdata-lifnr it_POdata-Bsart v_Date. "it_POdata-bedat.
if sy-subrc <> 0.
exit.
endif.
if v_checkBx = 'X'.
it_POdata1-Ebeln = it_POdata-Ebeln.
it_POdata1-lifnr = it_POdata-lifnr.
it_POdata1-Bsart = it_POdata-Bsart.
it_POdata1-bedat = v_date. "it_POdata-bedat.
append it_POdata1.
endif.
enddo.
sort it_POdata1.
select Ebeln ebelp netwr from ekpo into table it_TotalVal " This will Store all the net price for all the item
for all Entries in it_POdata1 " including the p/o number to sum up later on.
Where Ebeln = it_POdata1-Ebeln.
sort it_TotalVal.
perform display_SecondaryList. " This will display selected purchase order including Total Value in Local Currency
ENDCASE.
ENDCASE.
top-of-page.
perform display_Header.
********************************************************************************************************************************************
Function are Written here
form validate_CompCode .
select single * from T001 where Bukrs = v_CCode.
if sy-subrc <> 0.
message e046.
endif.
endform. " validate_CompCode
form display_Header .
Write:/ 'RAPIDIGM(INDIA) LTD',50 'LIST OF PO PRICING',70 'DATE',78 sy-datum.
if sy-lsind = 1.
Write:/50 'SECONDARY LIST', 70 'PAGE: ',78 sy-pagno.
else.
Write:/50 'BASIC LIST ', 70 'Page: ',78 sy-pagno.
Write:/ 'Display Basic List for Purchase Order'.
Write:/ 'Developer : Sanjay Yesi'.
endif.
uline.
endform. " display_Header
form Pouplate_it_POdata .
select MBukrs MEbeln MBsart MBedat Mekorg Mlifnr M~knumv into corresponding fields of table it_POdata from ekko as M
where MBukrs = v_CCode and Mekorg in v_POrg and MBedat in v_PDate and MEbeln in v_PONum.
endform. " Pouplate_it_POdata
form display_BasicList .
Write:/ 'Check', 15 'P/O NUM', 35 'POSTING', 50 'PO ORG ',60 'DOC',75 'VENDOR NO/'.
WRITE:/35 'DATE',60 'TYPE',75 'NAME'.
Write:/.
v_counter = 8.
LOOP AT IT_PODATA.
add 1 to v_counter.
perform get_VendorName.
v_Date = it_POdata-Bedat.
Write:/ v_CheckBx as checkbox,15 IT_PODATA-ebeln,35 IT_PODATA-Bedat,50 IT_PODATA-Ekorg, 60 IT_PODATA-Bsart,
75 IT_PODATA-lifnr, lfa1-name1.
ENDLOOP.
endform. " display_BasicList
form display_SecondaryList .
PERFORM display_Header.
Write:/ 'P/O NUM', 20 'VENDOR CODE', 60 'PO',70 'PO DATE',90 'TOTAL VALUE IN'.
WRITE:/20 'NAME',60 'TYPE',90 'LOCAL CURRENCY'.
Write:/.
LOOP AT it_POdata1.
read table it_POdata with key Ebeln = it_POdata1-Ebeln. " Used Just to Print Date Properly
perform get_VendorName.
perform get_TotalVal.
Write:/ it_POdata1-Ebeln,20 it_POdata1-lifnr,lfa1-name1,60 it_POdata1-Bsart,70 it_POdata-bedat,90 v_TotalVal.
HIDE: it_POdata1-Ebeln , it_POdata-BEDAT.
endloop.
endform. " display_SecondaryList
form get_VendorName .
select single * from lfa1 where lifnr = IT_PODATA1-lifnr.
endform. " get_VendorName
form get_TotalVal .
v_TotalVal = 0.
loop at it_TotalVal where Ebeln = it_POdata1-Ebeln.
v_TotalVal = v_TotalVal + it_TotalVal-netwr.
endloop.
endform. " get_TotalVal
FORM display_FinalHeader .
Write:/ 'PRICING DETAILS OF PURCHASE ORDER NUMBER:',50 it_POdata1-Ebeln.
Write:/ 'POSTING DATE:',20 IT_PODATA-BEDAT.
ULINE.
WRITE:/2 'ITEM NO',15 'MATERIAL',40 'QTY',55 'UOM',65'<--
>'.
WRITE:/65 'Type',83 'Rate',100 'Base',117 'Condition'.
Write:/100 'Value',117 'Value'.
uline.
ENDFORM. " display_FinalHeader
FORM display_FinalData .
sort it_POdata.
read table it_POdata with key Ebeln = it_POdata1-ebeln.
Populate Purchase Order detail for Item Number and Material Number.
select Ebeln ebelp matnr menge meins into corresponding fields of table it_PODetail from ekpo where ebeln = it_POdata1-ebeln.
Populate Document detail table with respect to Purchase Order Master
select knumv kposn kschl kbetr kwert kawrt into corresponding fields of table it_DocumentDetail from konv
where knumv = it_POdata-knumv.
sort it_PODetail.
sort it_DocumentDetail.
loop at it_PODetail. " Based on how many Items are there in Detail File
Write:/2 it_PODetail-Ebelp,15 it_PODetail-matnr,32 it_PODetail-menge,55 it_PODetail-meins.
loop at it_DocumentDetail where kposn = it_PODetail-Ebelp . " Many conditions are there per Item
Write: 65 it_DocumentDetail-kschl,75 it_DocumentDetail-kbetr,90 it_DocumentDetail-kawrt,
110 it_DocumentDetail-kwert.
Write:/.
v_CBValue = v_CBValue + it_DocumentDetail-kawrt.
v_CValue = v_CValue + it_DocumentDetail-kwert.
endloop.
uline at 65(62).
Write:/75 'Item Total',90 v_CBValue, 110 v_CValue.
uline.
v_CBValue = 0. v_CValue = 0.
endloop.
ENDFORM. " display_FinalData
2007 Mar 12 5:56 AM
Hi Please refer to the below programs that will help you .
DEMO_LIST_INTERACTIVE_1
DEMO_LIST_INTERACTIVE_2
DEMO_LIST_INTERACTIVE_3
DEMO_LIST_INTERACTIVE_4
2007 Mar 12 6:01 AM
Try copying the below program
and create two GUI status with name 'PURCHASEMENU' and 'PURCHASEMENU1' .. and there you are with the solution....
Assign the points if solved your probelm
&----
*& Report Z4SANINTERACTIVE
*&
&----
*&
*&
&----
REPORT Z4SANINTERACTIVE no standard page heading message-id z4.
tables: ekko, ekpo, konv, makt, T001, lfa1 .
selection-screen begin of block b1.
parameters: v_CCode like ekko-bukrs memory id BUK obligatory.
select-options: v_PDate for ekko-bedat,
v_POrg for ekko-Ekorg memory id EKO,
v_PONum for ekko-Ebeln memory id BES.
selection-screen end of block b1.
data: v_CheckBx.
data: v_counter type i. " variable to check how much time program has readline from the output list.
data: v_TotalVal like ekpo-netwr. " to sum total value in local currency
data: v_date(10).
data: v_CBValue type konv-kawrt.
data: v_CValue type konv-kwert.
data: begin of it_POdata occurs 0, " This table stores all the Purchase Order in the selected Range
Bukrs like ekko-Bukrs, " Company Code
Ebeln like ekko-Ebeln, " Purchase Order Number
Bedat like ekko-bedat, " Posting Date
Ekorg like ekko-Ekorg, " Purchasing Organization
Bsart like ekko-Bsart, " Doc Type
Lifnr like ekko-Lifnr, " Vendor Number.
knumv like ekko-knumv, " Number of Document Condition " This is the Common field between Ekko and konv(Condition Document)
end of it_POdata.
data: it_POdata1 like it_POdata occurs 0 with header line. " This Table is used to Store the Secondary List as the First internal
table is used to retrieve purchase order number including knumv
data: begin of it_TotalVal occurs 0, " Table used to store all the selected purchase order and calculate
Ebeln like ekpo-Ebeln, " Purchase Order Number " Total Value in Currency.
ebelp like ekpo-ebelp, " Item no.
netwr like ekpo-netwr, " Net Order Value.
end of it_TotalVal.
data: Begin of it_PODetail occurs 0, " Table used to store Purchase order detail used in Final list display
Ebeln like ekpo-Ebeln, " Purchase Order Number.
Ebelp like ekpo-ebelp, " Item Number,
matnr like ekpo-matnr, " Material Number
menge like ekpo-menge, " Quantity
meins like ekpo-meins, " Unit of Measurement
end of it_PODetail.
data: begin of it_DocumentDetail occurs 0, " This Table is used to Retrieve the information with Reference to
knumv like konv-knumv, " Number of Document Condition " P/O and knumv used in Final List
kposn like konv-kposn, " Condition Item Number
kschl like konv-kschl, " Condition type
kbetr like konv-kbetr, " Rate(Amount or Percentage)
kwert like konv-kwert, " Condition Value
kawrt like konv-kawrt, " Condition Base Value
end of it_DocumentDetail.
at selection-screen.
perform validate_CompCode. " This Function Validates Company Code if it Exist in its Master File.
start-of-selection.
set pf-status 'PURCHASEMENU'. " This Menu Displays The Execute Button.
perform Pouplate_it_POdata. " This Function Populates all the P/O Selected in range.
perform display_BasicList. " This Display Basic List including Check Boxes.
*at selection-screen output.
*get parameter id 'BUK' field v_CCode.
*
AT LINE-SELECTION. " This Event is Trigerred at Final list selection as only case 2 is handled.
CASE SY-LSIND.
WHEN 2.
perform display_FinalHeader. " This will display the header info
perform display_FinalData. " This uses it_DocumentDetail table to display Final List
ENDCASE.
AT USER-COMMAND.
CASE SY-UCOMM.
WHEN 'EXT1'.
SET SCREEN 0.
LEAVE SCREEN.
WHEN 'EXE1'.
CASE SY-LSIND.
WHEN 1.
set pf-status 'PURCHASEMENU1'.
refresh it_POdata1. " This Store all the Selected Purchase Order
do v_counter times.
read line sy-index field value v_checkBx it_POdata-Ebeln it_POdata-lifnr it_POdata-Bsart v_Date. "it_POdata-bedat.
if sy-subrc <> 0.
exit.
endif.
if v_checkBx = 'X'.
it_POdata1-Ebeln = it_POdata-Ebeln.
it_POdata1-lifnr = it_POdata-lifnr.
it_POdata1-Bsart = it_POdata-Bsart.
it_POdata1-bedat = v_date. "it_POdata-bedat.
append it_POdata1.
endif.
enddo.
sort it_POdata1.
select Ebeln ebelp netwr from ekpo into table it_TotalVal " This will Store all the net price for all the item
for all Entries in it_POdata1 " including the p/o number to sum up later on.
Where Ebeln = it_POdata1-Ebeln.
sort it_TotalVal.
perform display_SecondaryList. " This will display selected purchase order including Total Value in Local Currency
ENDCASE.
ENDCASE.
top-of-page.
perform display_Header.
********************************************************************************************************************************************
Function are Written here
form validate_CompCode .
select single * from T001 where Bukrs = v_CCode.
if sy-subrc <> 0.
message e046.
endif.
endform. " validate_CompCode
form display_Header .
Write:/ 'RAPIDIGM(INDIA) LTD',50 'LIST OF PO PRICING',70 'DATE',78 sy-datum.
if sy-lsind = 1.
Write:/50 'SECONDARY LIST', 70 'PAGE: ',78 sy-pagno.
else.
Write:/50 'BASIC LIST ', 70 'Page: ',78 sy-pagno.
Write:/ 'Display Basic List for Purchase Order'.
Write:/ 'Developer : Sanjay Yesi'.
endif.
uline.
endform. " display_Header
form Pouplate_it_POdata .
select MBukrs MEbeln MBsart MBedat Mekorg Mlifnr M~knumv into corresponding fields of table it_POdata from ekko as M
where MBukrs = v_CCode and Mekorg in v_POrg and MBedat in v_PDate and MEbeln in v_PONum.
endform. " Pouplate_it_POdata
form display_BasicList .
Write:/ 'Check', 15 'P/O NUM', 35 'POSTING', 50 'PO ORG ',60 'DOC',75 'VENDOR NO/'.
WRITE:/35 'DATE',60 'TYPE',75 'NAME'.
Write:/.
v_counter = 8.
LOOP AT IT_PODATA.
add 1 to v_counter.
perform get_VendorName.
v_Date = it_POdata-Bedat.
Write:/ v_CheckBx as checkbox,15 IT_PODATA-ebeln,35 IT_PODATA-Bedat,50 IT_PODATA-Ekorg, 60 IT_PODATA-Bsart,
75 IT_PODATA-lifnr, lfa1-name1.
ENDLOOP.
endform. " display_BasicList
form display_SecondaryList .
PERFORM display_Header.
Write:/ 'P/O NUM', 20 'VENDOR CODE', 60 'PO',70 'PO DATE',90 'TOTAL VALUE IN'.
WRITE:/20 'NAME',60 'TYPE',90 'LOCAL CURRENCY'.
Write:/.
LOOP AT it_POdata1.
read table it_POdata with key Ebeln = it_POdata1-Ebeln. " Used Just to Print Date Properly
perform get_VendorName.
perform get_TotalVal.
Write:/ it_POdata1-Ebeln,20 it_POdata1-lifnr,lfa1-name1,60 it_POdata1-Bsart,70 it_POdata-bedat,90 v_TotalVal.
HIDE: it_POdata1-Ebeln , it_POdata-BEDAT.
endloop.
endform. " display_SecondaryList
form get_VendorName .
select single * from lfa1 where lifnr = IT_PODATA1-lifnr.
endform. " get_VendorName
form get_TotalVal .
v_TotalVal = 0.
loop at it_TotalVal where Ebeln = it_POdata1-Ebeln.
v_TotalVal = v_TotalVal + it_TotalVal-netwr.
endloop.
endform. " get_TotalVal
FORM display_FinalHeader .
Write:/ 'PRICING DETAILS OF PURCHASE ORDER NUMBER:',50 it_POdata1-Ebeln.
Write:/ 'POSTING DATE:',20 IT_PODATA-BEDAT.
ULINE.
WRITE:/2 'ITEM NO',15 'MATERIAL',40 'QTY',55 'UOM',65'<--
>'.
WRITE:/65 'Type',83 'Rate',100 'Base',117 'Condition'.
Write:/100 'Value',117 'Value'.
uline.
ENDFORM. " display_FinalHeader
FORM display_FinalData .
sort it_POdata.
read table it_POdata with key Ebeln = it_POdata1-ebeln.
Populate Purchase Order detail for Item Number and Material Number.
select Ebeln ebelp matnr menge meins into corresponding fields of table it_PODetail from ekpo where ebeln = it_POdata1-ebeln.
Populate Document detail table with respect to Purchase Order Master
select knumv kposn kschl kbetr kwert kawrt into corresponding fields of table it_DocumentDetail from konv
where knumv = it_POdata-knumv.
sort it_PODetail.
sort it_DocumentDetail.
loop at it_PODetail. " Based on how many Items are there in Detail File
Write:/2 it_PODetail-Ebelp,15 it_PODetail-matnr,32 it_PODetail-menge,55 it_PODetail-meins.
loop at it_DocumentDetail where kposn = it_PODetail-Ebelp . " Many conditions are there per Item
Write: 65 it_DocumentDetail-kschl,75 it_DocumentDetail-kbetr,90 it_DocumentDetail-kawrt,
110 it_DocumentDetail-kwert.
Write:/.
v_CBValue = v_CBValue + it_DocumentDetail-kawrt.
v_CValue = v_CValue + it_DocumentDetail-kwert.
endloop.
uline at 65(62).
Write:/75 'Item Total',90 v_CBValue, 110 v_CValue.
uline.
v_CBValue = 0. v_CValue = 0.
endloop.
ENDFORM. " display_FinalData
| User | Count |
|---|---|
| 6 | |
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |