Report for displaying the order number & order date..
HI ALL,
can any body help me for displaying the order number,customer name,material name & order date..in report
i dnt know the which are the table i need to use...
can anybody tell me which are table do i need to use and fields in tables
input to report from the user are cutomer number,purchase order numbervendor number & sales number
waiting for positive reply form u people.....
thanks
Zabeerulla
Moderator message: "spec dumping", please work yourself first on your requirement, do some research, talk to a functional consultant near you.
Edited by: Thomas Zloch on Feb 28, 2011 2:14 PM
Thx dharma raj ...
problem is ,input to report from the user are cutomer number,purchase order number,vendor number & sales number
report should contain
customer name
order date
order #
vendor name
material name
can u please tell me which are the table do i need to use...
i have ,please look into it...let me know if am incorrect
customer name -> kna1_name where kna1_kunnr=knagv_kunnr
order date -> vbak_audat
order nunber->vbak_vbeln
vendor name -> LFA1_NAME where LFA1_LIFNR=MEPO_TOPLINE(superfileld)
material # -> VBAP_ARKTX where VBAP_VBELN=VBAK_VBELN
HELP ME OUT...
THX
ZABEER
Similar Messages
-
How 2 creat report for displaying the details of a Delivery Document using
how to create report for displaying the details of a Delivery Document using the tables LIKP, LIPS
thank you
regards,
jagrut bharatkumar shukla
points will be rewardedHI
I AM GIVING YOU MY DELIVERY DOCUMENT CODE...MODIFY IT ACCORDING TO YOUR REQUIREMENT
*& Report ZDELIVERY *
report zdelivery message-id z9bhu .
types: begin of t_likp,
vbeln type likp-vbeln, "Delivery
erdat type likp-erdat, "Date for rec creation
* LFDAT TYPE LIKP-LFDAT, "Delevery Date
* WAERK TYPE LIKP-WAERK, "Currency
kunnr type likp-kunnr, "Ship-To Party
kunag type likp-kunag, "Sold-to party
traty type likp-traty, "Means-of-Transport
end of t_likp.
types: begin of t_lips,
vbeln type lips-vbeln, "Delivery
posnr type lips-posnr, "Delivery item
matnr type lips-matnr, "Material Number
arktx type lips-arktx, "Short Text for Sales Order Item
lfimg type lips-lfimg, "Actual quantity delivered
netpr type lips-netpr,
* MEINS TYPE LIPS-MEINS, "Base Unit of Measure
vgbel type lips-vgbel, "Doc no of the reference document
end of t_lips.
types: begin of t_vbpa,
vbeln type vbpa-vbeln, "SD DocumenT Number
posnr type vbpa-posnr, "Item number
parvw type vbpa-parvw, "Partner function
kunnrb type vbpa-kunnr, "Customer Number 1
end of t_vbpa.
types: begin of t_kna1,
kunnr type kna1-kunnr, "Customer Number 1
name1 type kna1-name1, "Name 1
ort01 type kna1-ort01, "City
adrnr type kna1-adrnr, "Address
end of t_kna1.
types: begin of t_li_vbpa,
vbeln type likp-vbeln, "Delivery
erdat type likp-erdat, "Date for rec creation
* LFDAT TYPE LIKP-LFDAT, "Delevery Date
* WAERK TYPE LIKP-WAERK, "Currency
kunnr type likp-kunnr, "Ship-To Party
kunag type likp-kunag, "Sold-to party
traty type likp-traty, "Means-of-Transport
vbeln1 type lips-vbeln, "Delivery
posnr type lips-posnr, "Delivery item
matnr type lips-matnr, "Material Number
arktx type lips-arktx, "Short Text for Sales Order Item
lfimg type lips-lfimg, "Actual quantity delivered
netpr type lips-netpr, "Net Price
* MEINS TYPE LIPS-MEINS, "Base Unit of Measure
vgbel type lips-vgbel, "Doc no of the reference document
vbeln3 type vbpa-vbeln, "SD DocumenT Number
parvw type vbpa-parvw, "Partner function
kunnrb type vbpa-kunnr, "Customer Number 1
end of t_li_vbpa.
types: begin of t_final,
vbeln type likp-vbeln, "Delivery
erdat type likp-erdat, "Date for rec creation
kunnr type likp-kunnr, "Ship-To Party
kunag type likp-kunag, "Sold-to party
traty type likp-traty, "Means-of-Transport
vbeln1 type lips-vbeln, "Delivery
posnr type lips-posnr, "Delivery item
matnr type lips-matnr, "Material Number
arktx type lips-arktx, "Short Text for Sales Order Item
lfimg type lips-lfimg, "Actual quantity delivered
netpr type lips-netpr, "Net Price
vgbel type lips-vgbel, "Doc no of the reference document
vbeln3 type vbpa-vbeln, "SD DocumenT Number
parvw type vbpa-parvw, "Partner function
kunnrb type vbpa-kunnr, "Customer Number 1
name1 type kna1-name1, "Name 1
ort01 type kna1-ort01, "City
adrnr1 type kna1-adrnr, "Address
name2 type kna1-name1, "Name 1
ort02 type kna1-ort01, "City
adrnr2 type kna1-adrnr, "Address
name3 type kna1-name1, "Name 1
ort03 type kna1-ort01, "City
adrnr3 type kna1-adrnr, "Address
end of t_final.
* D A T A D E C L A R A T I O N
*&*********Internal Table Declaration****************&*
data: it_likp type standard table of t_likp.
data: it_lips type standard table of t_lips.
data: it_vbpa type standard table of t_vbpa.
data: it_kna1 type standard table of t_kna1.
data: it_li_vbpa type standard table of t_li_vbpa.
data: it_li_vbpa_temp type standard table of t_li_vbpa.
data: it_final type standard table of t_final.
*&*********Work Area Declaration********************&*
data: wa_likp type t_likp.
data: wa_lips type t_lips.
data: wa_vbpa type t_vbpa.
data: wa_kna1 type t_kna1.
data: wa_li_vbpa type t_li_vbpa.
data: wa_li_vbpa_temp type t_li_vbpa.
data: wa_final type t_final.
*&*********Data Declaration************************&*
data: d_vbeln type likp-vbeln.
data: flag type i value 0.
* S E L E C T I O N S C R E E N D E C L A R A T I O N
selection-screen begin of block block2 with frame title text-001.
select-options: s_vbeln for d_vbeln obligatory. "Delivery no
selection-screen end of block block2.
* A T S E L E C T I O N - S C R E E N E V E N T S
*AT SELECTION-SCREEN.
*PERFORM VALIDATE_DATA.
* S T A R T O F S E L E C T I O N E V E N T S
start-of-selection.
perform fetch_data.
perform merge_data_kna1.
*INCLUDE Z9BT_SH_***4_FORMS.
call function 'OPEN_FORM'
exporting
* APPLICATION = 'TX'
* ARCHIVE_INDEX =
* ARCHIVE_PARAMS =
device = 'PRINTER'
* DIALOG = 'X'
* FORM = ' '
language = sy-langu
* OPTIONS =
* MAIL_SENDER =
* MAIL_RECIPIENT =
* MAIL_APPL_OBJECT =
* RAW_DATA_INTERFACE = '*'
* SPONUMIV =
* IMPORTING
* LANGUAGE =
* NEW_ARCHIVE_PARAMS =
* RESULT =
exceptions
canceled = 1
device = 2
form = 3
options = 4
unclosed = 5
mail_options = 6
archive_error = 7
invalid_fax_number = 8
more_params_needed_in_batch = 9
spool_error = 10
codepage = 11
others = 12
if sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
sort it_final by vbeln.
loop at it_final into wa_final.
call function 'START_FORM'
exporting
* ARCHIVE_INDEX =
form = 'Z9BT_DELIVERY'
language = sy-langu
* STARTPAGE = ' '
* PROGRAM = ' '
* MAIL_APPL_OBJECT =
* IMPORTING
* LANGUAGE =
exceptions
form = 1
format = 2
unended = 3
unopened = 4
unused = 5
spool_error = 6
codepage = 7
others = 8
if sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
call function 'WRITE_FORM'
exporting
element = 'ITEM_LIST'
function = 'SET'
type = 'BODY'
window = 'MAIN'
* IMPORTING
* PENDING_LINES =
* EXCEPTIONS
* ELEMENT = 1
* FUNCTION = 2
* TYPE = 3
* UNOPENED = 4
* UNSTARTED = 5
* WINDOW = 6
* BAD_PAGEFORMAT_FOR_PRINT = 7
* SPOOL_ERROR = 8
* CODEPAGE = 9
* OTHERS = 10
if sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
call function 'END_FORM'
* IMPORTING
* RESULT =
exceptions
unopened = 1
bad_pageformat_for_print = 2
spool_error = 3
codepage = 4
others = 5
if sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
endloop.
call function 'CLOSE_FORM'
* IMPORTING
* RESULT =
* RDI_RESULT =
* TABLES
* OTFDATA =
exceptions
unopened = 1
bad_pageformat_for_print = 2
send_error = 3
spool_error = 4
codepage = 5
others = 6
if sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
*& Form VALIDATE_DATA
* text
* --> p1 text
* <-- p2 text
form validate_data .
select single vbeln into wa_likp-vbeln
from likp where vbeln in s_vbeln.
append wa_likp to it_likp.
if sy-subrc <> 0.
flag = 1.
endif.
endform. " VALIDATE_DATA
*& Form FETCH_DATA
* text
* --> p1 text
* <-- p2 text
form fetch_data .
select a~vbeln
a~erdat
a~kunnr
a~kunag
a~traty
b~vbeln
b~posnr
b~matnr
b~arktx
b~lfimg
b~netpr
b~vgbel
c~vbeln
c~parvw
c~kunnr
into table it_li_vbpa
from likp as a
left outer join lips as b on a~vbeln = b~vbeln
inner join vbpa as c on b~vgbel = c~vbeln
where a~vbeln in s_vbeln and
c~parvw = 'RE'.
endform. " FETCH_DATA
*& Form MERGE_DATA_KNA1
* text
* --> p1 text
* <-- p2 text
form merge_data_kna1 .
if it_li_vbpa[] is not initial.
it_li_vbpa_temp[] = it_li_vbpa[].
sort it_li_vbpa_temp by kunnr.
delete adjacent duplicates from it_li_vbpa_temp comparing kunnr.
loop at it_li_vbpa into wa_li_vbpa.
read table it_li_vbpa_temp into wa_li_vbpa_temp with key kunnr =
wa_li_vbpa-kunag.
if sy-subrc <> 0.
wa_li_vbpa_temp = wa_li_vbpa.
append wa_li_vbpa_temp to it_li_vbpa_temp.
endif.
read table it_li_vbpa_temp into wa_li_vbpa_temp with key kunnr =
wa_li_vbpa-kunnrb.
if sy-subrc <> 0.
wa_li_vbpa_temp = wa_li_vbpa.
append wa_li_vbpa_temp to it_li_vbpa_temp.
endif.
endloop.
endif.
if it_li_vbpa_temp[] is not initial.
select kunnr
name1
ort01
adrnr into table it_kna1 from kna1
for all entries in it_li_vbpa_temp
where kunnr = it_li_vbpa_temp-kunnr.
endif.
loop at it_li_vbpa into wa_li_vbpa .
wa_final-vbeln = wa_li_vbpa-vbeln.
wa_final-erdat = wa_li_vbpa-erdat.
*it_final-LFART = it_li_vbpa-LFART.
wa_final-kunnr = wa_li_vbpa-kunnr.
wa_final-kunag = wa_li_vbpa-kunag.
*it_final-VSTEL = it_li_vbpa-VSTEL.
wa_final-traty = wa_li_vbpa-traty.
wa_final-vbeln1 = wa_li_vbpa-vbeln.
wa_final-posnr = wa_li_vbpa-posnr.
wa_final-matnr = wa_li_vbpa-matnr.
wa_final-arktx = wa_li_vbpa-arktx.
wa_final-lfimg = wa_li_vbpa-lfimg.
wa_final-netpr = wa_li_vbpa-netpr.
*wa_final-GEWEI = it_li_vbpa-GEWEI.
*it_final-VOLUM = it_li_vbpa-VOLUM.
*it_final-VOLEH = it_li_vbpa-VOLEH.
wa_final-vgbel = wa_li_vbpa-vgbel.
wa_final-vbeln3 = wa_li_vbpa-vbeln.
*wa_final-PARVW = wa_li_vbpa-PARVW.
wa_final-kunnrb = wa_li_vbpa-kunnrb.
read table it_kna1 into wa_kna1 with key kunnr = wa_li_vbpa-kunnr.
if sy-subrc = 0.
wa_final-name1 = wa_kna1-name1.
wa_final-ort01 = wa_kna1-ort01.
wa_final-adrnr1 = wa_kna1-adrnr.
endif.
read table it_kna1 into wa_kna1 with key kunnr = wa_li_vbpa-kunag.
if sy-subrc = 0.
wa_final-name2 = wa_kna1-name1.
wa_final-ort02 = wa_kna1-ort01.
wa_final-adrnr2 = wa_kna1-adrnr.
endif.
read table it_kna1 into wa_kna1 with key kunnr = wa_li_vbpa-kunnrb.
if sy-subrc = 0.
wa_final-name3 = wa_kna1-name1.
wa_final-ort03 = wa_kna1-ort01.
wa_final-adrnr3 = wa_kna1-adrnr.
endif.
append wa_final to it_final.
clear wa_final.
endloop.
endform. -
Report for Displaying the Surplus Orders
Hi all
I have a issue where due to the Net requirment calculation the system is generating the Surplus Order equal to Fixed Lot size set. Is their any report to find out the Surplus order in the Product Master which is not being pegged to Requirment Or orders with no Pegging.Thx dharma raj ...
problem is ,input to report from the user are cutomer number,purchase order number,vendor number & sales number
report should contain
customer name
order date
order #
vendor name
material name
can u please tell me which are the table do i need to use...
i have ,please look into it...let me know if am incorrect
customer name -> kna1_name where kna1_kunnr=knagv_kunnr
order date -> vbak_audat
order nunber->vbak_vbeln
vendor name -> LFA1_NAME where LFA1_LIFNR=MEPO_TOPLINE(superfileld)
material # -> VBAP_ARKTX where VBAP_VBELN=VBAK_VBELN
HELP ME OUT...
THX
ZABEER -
Want to generate a report for displaying the top 30 revenue generating regn
Hi Team
I was trying to generate top 30 revenue generating regions using " Edit Formula " option (Ofcouse there are other methods to do it , but i was trying out with this one ).
The scenario is : -
I have selected four columns i.e Year , Region , Product Type and Revenue.And i wanna display the top 30 revenue generating regions.
Steps I follwed : -
1> Selected the 4 columns (Year , Region , Product Type and Revenue )
2> Arranged the Revnue Column in descending order.
3> Went to --- > Revenue Column ---> Edit formula (fx) and used the COUNT(*) function.
i.e select "F1 Revenue"."1-01 Revenue (Sum All)" from "Sample Sales" where COUNT(*) <30
but I am getting error while doing so
Please guide
Thanks RohitHi Paul
Thanks for the quick response.
But I only want to restrict my output to 30 top records. Is there any way out ..?
and moreover Could you please suggest what went wrong in my previous query..?
Thanks
Rohit -
Report for display the list with details of quantity stock order etc
Can anybody give the code to display a list with details of quantity stock for specific materials in specific plants or storage locations based on the input values like plant, storage location, material and product hierarchy entered on the selection screen?
Yes it is possible.
we can try doing this by user exsits. with one of our client we have added a new tab in MIGO transaction.
For details on user exsits user below links
Check out the below links
http://www.sap-img.com/abap/what-is-user-exits.htm
http://www.sap-img.com/abap/a-short-tutorial-on-user-exits.htm
http://www.sapgenie.com/abap/code/abap26.htm
here is the user exit examples..
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/6378ef94-0501-0010-19a5-972687ddc9ef
all the user exits for sd
https://www.sdn.sap.com/irj/sdn/wiki?path=/display/erplo/sd%2buser%2bexits
Regards -
Display the total number of rows for the report in OBIEE 11g
Hi, In obiee 11g, the pagination will be 1-25. Is there any possiblity in obiee to show the total rows count next to pagination. Ex: if the result contains 120 rows. it should display after the pagination
Records 1-25. Total of Records : 120
Is there any way we can display the total number of rows for the report.
Kindly help me.. Its very urgent requirement.
MAny Thank in advacneCheck this http://obiee100.blogspot.com/2011/07/display-total-number-of-records-in.html
and
http://docs.oracle.com/cd/E28280_01/bi.1111/e10544/appsql.htm#CHDCDIDA
You have to go something like as suggested in previous link.
Mark as correct/helpful -
Fuba or Report for Change the OBJECT_ID in one order documents
Hi Guru's
we want to reuser the Order-ID in CRM contracts (CRMD_BUS2000121)
So I search a FuBa or a report for Changing the OBJECT_Id in the one order document or is there any other possibility.
we use SAPCRM 4.0
thanks
ReinerHi Reiner,
changing a Order or Contract ID is not possible because they are the key of the Object. Perhaps I've don't get your point. Please describe your requirement in more detail.
Regards
Gregor -
I Need Interactive Report for displaying vendor information. Based on the s
Interactive Report for displaying vendor information. Based on the selection made by the corresponding Vendor Bank Details are listed such that the line selected in the basic list was visible along with the secondary list.
hi
Hi
Use the Table LFA1 and LFB1 in the basic list
and LFBK table details in the secondary list
see the sample code related to customer Sales orders
modify it with the Vendor tables
REPORT ZTEJ_INTAB1 LINE-SIZE 103 LINE-COUNT 35(5) NO STANDARD PAGE
HEADING.
*TABLES DECLARATION
TABLES : KNA1, VBAK, VBAP.
*SELECT OPTIONS
SELECT-OPTIONS: CUST_NO FOR KNA1-KUNNR.
*INITIALIZATION
INITIALIZATION.
CUST_NO-LOW = '01'.
CUST_NO-HIGH = '5000'.
CUST_NO-SIGN = 'I'.
CUST_NO-OPTION = 'BT'.
APPEND CUST_NO.
*SELECTION SCREEN VALIDATION
AT SELECTION-SCREEN ON CUST_NO.
LOOP AT SCREEN.
IF CUST_NO-LOW < 1 OR CUST_NO-HIGH > 5000.
MESSAGE E001(ZTJ1).
ENDIF.
ENDLOOP.
*BASIC LIST SELECTION
START-OF-SELECTION.
SELECT KUNNR NAME1 ORT01 LAND1 INTO
(KNA1-KUNNR, KNA1-NAME1,KNA1-ORT01,KNA1-LAND1)
FROM KNA1
WHERE KUNNR IN CUST_NO.
WRITE:/1 SY-VLINE,
KNA1-KUNNR UNDER 'CUSTOMER NO.' HOTSPOT ON,
16 SY-VLINE,
KNA1-NAME1 UNDER 'NAME',
61 SY-VLINE,
KNA1-ORT01 UNDER 'CITY',
86 SY-VLINE,
KNA1-LAND1 UNDER 'COUNTRY',
103 SY-VLINE.
HIDE: KNA1-KUNNR.
ENDSELECT.
ULINE.
*SECONDARY LIST ACCESS
AT user-command.
IF SY-UCOMM = 'IONE'.
PERFORM SALES_ORD.
ENDIF.
IF SY-UCOMM = 'ITWO'.
PERFORM ITEM_DET.
ENDIF.
*TOP OF PAGE
TOP-OF-PAGE.
FORMAT COLOR 1.
WRITE : 'CUSTOMER DETAILS'.
FORMAT COLOR 1 OFF.
ULINE.
FORMAT COLOR 3.
WRITE : 1 SY-VLINE,
3 'CUSTOMER NO.',
16 SY-VLINE,
18 'NAME',
61 SY-VLINE,
63 'CITY',
86 SY-VLINE,
88 'COUNTRY',
103 SY-VLINE.
ULINE.
FORMAT COLOR 3 OFF.
*TOP OF PAGE FOR SECONDARY LISTS
TOP-OF-PAGE DURING LINE-SELECTION.
*TOP OF PAGE FOR 1ST SECONDARY LIST
IF SY-UCOMM = 'IONE'.
ULINE.
FORMAT COLOR 1.
WRITE : 'SALES ORDER DETAILS'.
ULINE.
FORMAT COLOR 1 OFF.
FORMAT COLOR 3.
WRITE : 1 SY-VLINE,
3 'CUSTOMER NO.',
16 SY-VLINE,
18 'SALES ORDER NO.',
40 SY-VLINE,
42 'DATE',
60 SY-VLINE,
62 'CREATOR',
85 SY-VLINE,
87 'DOC DATE',
103 SY-VLINE.
ULINE.
ENDIF.
FORMAT COLOR 3 OFF.
*TOP OF PAGE FOR 2ND SECONDARY LIST
IF SY-UCOMM = 'ITWO'.
ULINE.
FORMAT COLOR 1.
WRITE : 'ITEM DETAILS'.
ULINE.
FORMAT COLOR 1 OFF.
FORMAT COLOR 3.
WRITE : 1 SY-VLINE,
3 'SALES ORDER NO.',
40 SY-VLINE,
42 'SALES ITEM NO.',
60 SY-VLINE,
62 'ORDER QUANTITY',
103 SY-VLINE.
ULINE.
ENDIF.
FORMAT COLOR 3 OFF.
*END OF PAGE
END-OF-PAGE.
ULINE.
WRITE :'USER :',SY-UNAME,/,'DATE :', SY-DATUM, 85 'END OF PAGE:',
SY-PAGNO.
SKIP.
*& Form SALES_ORD
*& FIRST SECONDARY LIST FORM
FORM SALES_ORD .
SELECT KUNNR VBELN ERDAT ERNAM AUDAT INTO
(VBAK-KUNNR, VBAK-VBELN, VBAK-ERDAT, VBAK-ERNAM, VBAK-AUDAT)
FROM VBAK
WHERE KUNNR = KNA1-KUNNR.
WRITE:/1 SY-VLINE,
VBAK-KUNNR UNDER 'CUSTOMER NO.' HOTSPOT ON,
16 SY-VLINE,
VBAK-VBELN UNDER 'SALES ORDER NO.' HOTSPOT ON,
40 SY-VLINE,
VBAK-ERDAT UNDER 'DATE',
60 SY-VLINE,
VBAK-ERNAM UNDER 'CREATOR',
85 SY-VLINE,
VBAK-AUDAT UNDER 'DOC DATE',
103 SY-VLINE.
HIDE : VBAK-VBELN.
ENDSELECT.
ULINE.
ENDFORM. " SALES_ORD
*& Form ITEM_DET
*& SECOND SECONDARY LIST FORM
FORM ITEM_DET .
SELECT VBELN POSNR KWMENG INTO
(VBAP-VBELN, VBAP-POSNR, VBAP-KWMENG)
FROM VBAP
WHERE VBELN = VBAK-VBELN.
WRITE : /1 SY-VLINE,
VBAP-VBELN UNDER 'SALES ORDER NO.',
40 SY-VLINE,
VBAP-POSNR UNDER 'SALES ITEM NO.',
60 SY-VLINE,
VBAP-KWMENG UNDER 'ORDER QUANTITY',
103 SY-VLINE.
ENDSELECT.
ULINE.
ENDFORM. " ITEM_DET
REPORT demo_list_at_pf.
START-OF-SELECTION.
WRITE 'Basic List, Press PF5, PF6, PF7, or PF8'.
AT pf5.
PERFORM out.
AT pf6.
PERFORM out.
AT pf7.
PERFORM out.
AT pf8.
PERFORM out.
FORM out.
WRITE: 'Secondary List by PF-Key Selection',
/ 'SY-LSIND =', sy-lsind,
/ 'SY-UCOMM =', sy-ucomm.
ENDFORM.
After executing the program, the system displays the basic list. The user can press the function keys F5 , F6 , F7 , and F8 to create secondary lists. If, for example, the 14th key the user presses is F6 , the output on the displayed secondary list looks as follows:
Secondary List by PF-Key Selection
SY-LSIND = 14
SY-UCOMM = PF06
Example for AT USER-COMMAND.
REPORT demo_list_at_user_command NO STANDARD PAGE HEADING.
START-OF-SELECTION.
WRITE: 'Basic List',
/ 'SY-LSIND:', sy-lsind.
TOP-OF-PAGE.
WRITE 'Top-of-Page'.
ULINE.
TOP-OF-PAGE DURING LINE-SELECTION.
CASE sy-pfkey.
WHEN 'TEST'.
WRITE 'Self-defined GUI for Function Codes'.
ULINE.
ENDCASE.
AT LINE-SELECTION.
SET PF-STATUS 'TEST' EXCLUDING 'PICK'.
PERFORM out.
sy-lsind = sy-lsind - 1.
AT USER-COMMAND.
CASE sy-ucomm.
WHEN 'FC1'.
PERFORM out.
WRITE / 'Button FUN 1 was pressed'.
WHEN 'FC2'.
PERFORM out.
WRITE / 'Button FUN 2 was pressed'.
WHEN 'FC3'.
PERFORM out.
WRITE / 'Button FUN 3 was pressed'.
WHEN 'FC4'.
PERFORM out.
WRITE / 'Button FUN 4 was pressed'.
WHEN 'FC5'.
PERFORM out.
WRITE / 'Button FUN 5 was pressed'.
ENDCASE.
sy-lsind = sy-lsind - 1.
FORM out.
WRITE: 'Secondary List',
/ 'SY-LSIND:', sy-lsind,
/ 'SY-PFKEY:', sy-pfkey.
ENDFORM.
<b>Vendor performance report</b>
See this sample code
*"Table declarations...................................................
TABLES:
EKKO, " Purchasing Document Header
CDHDR, " Change document header
SSCRFIELDS. " Fields on selection screens
*"Selection screen elements............................................
SELECT-OPTIONS:
S_EBELN FOR EKKO-EBELN, " Purchasing Document Number
S_LIFNR FOR EKKO-LIFNR, " Vendor's account number
S_EKGRP FOR EKKO-EKGRP, " Purchasing group
S_BEDAT FOR EKKO-BEDAT, " Purchasing Document Date
S_UDATE FOR CDHDR-UDATE. " Creation date of the change
" document
*" Data declarations...................................................
Field String to hold Purchase Document Number *
DATA:
BEGIN OF FS_EBELN,
EBELN(90) TYPE C, " Purchase Document Number
ERNAM TYPE EKKO-ERNAM, " Name of Person who Created
" the Object
LIFNR TYPE EKKO-LIFNR, " Vendor's account number
EKGRP TYPE EKKO-EKGRP, " Purchasing group
BEDAT TYPE EKKO-BEDAT, " Purchasing Document Date
END OF FS_EBELN,
Field String to hold Purchase Document Header *
BEGIN OF FS_EKKO,
EBELN TYPE EKKO-EBELN, " Purchasing Document Number
ERNAM TYPE EKKO-ERNAM, " Name of Person who Created the
" Object
LIFNR TYPE EKKO-LIFNR, " Vendor's account number
EKGRP TYPE EKKO-EKGRP, " Purchasing group
BEDAT TYPE EKKO-BEDAT, " Purchasing Document Date
END OF FS_EKKO,
Field String to hold Account Number and name of the Vendor *
BEGIN OF FS_LFA1,
LIFNR TYPE LFA1-LIFNR, " Account Number of Vendor
NAME1 TYPE LFA1-NAME1, " Name1
END OF FS_LFA1,
Field String to hold Change date and the name of the user *
BEGIN OF FS_CDHDR,
OBJECTCLAS TYPE CDHDR-OBJECTCLAS, " Object Class
OBJECTID TYPE CDHDR-OBJECTID, " Object value
CHANGENR TYPE CDHDR-CHANGENR, " Document change number
USERNAME TYPE CDHDR-USERNAME, " User name
UDATE TYPE CDHDR-UDATE, " Creation date of the change
" document
END OF FS_CDHDR,
Field String to hold Change document items *
BEGIN OF FS_CDPOS,
OBJECTCLAS TYPE CDPOS-OBJECTCLAS," Object class
OBJECTID(10) TYPE C, " Object Value
CHANGENR TYPE CDPOS-CHANGENR, " Document change number
TABNAME TYPE CDPOS-TABNAME, " Table Name
FNAME TYPE CDPOS-FNAME, " Field Name
VALUE_NEW TYPE CDPOS-VALUE_NEW, " New contents of changed field
VALUE_OLD TYPE CDPOS-VALUE_OLD, " Old contents of changed field
END OF FS_CDPOS,
Field String to hold Date Element Name *
BEGIN OF FS_DATAELE,
TABNAME TYPE DD03L-TABNAME, " Table Name
FIELDNAME TYPE DD03L-FIELDNAME, " Field Name
ROLLNAME TYPE DD03L-ROLLNAME, " Data element (semantic domain)
END OF FS_DATAELE,
Field String to hold Short Text of the Date Element *
BEGIN OF FS_TEXT,
ROLLNAME TYPE DD04T-ROLLNAME, " Data element (semantic domain)
DDTEXT TYPE DD04T-DDTEXT, " Short Text Describing R/3
" Repository Objects
END OF FS_TEXT,
Field String to hold data to be displayed on the ALV grid *
BEGIN OF FS_OUTTAB,
EBELN TYPE EKKO-EBELN, " Purchasing Document Number
ERNAM TYPE EKKO-ERNAM, " Name of Person who Created the
" Object
LIFNR TYPE EKKO-LIFNR, " Vendor's account number
EKGRP TYPE EKKO-EKGRP, " Purchasing group
BEDAT TYPE EKKO-BEDAT, " Purchasing Document Date
WERKS TYPE LFA1-WERKS, " Plant
NAME1 TYPE LFA1-NAME1, " Name1
USERNAME TYPE CDHDR-USERNAME, " User name
UDATE TYPE CDHDR-UDATE, " Creation date of the change
" document
DDTEXT TYPE DD04T-DDTEXT, " Short Text Describing R/3
" Repository Objects
VALUE_NEW TYPE CDPOS-VALUE_NEW, " New contents of changed field
VALUE_OLD TYPE CDPOS-VALUE_OLD, " Old contents of changed field
END OF FS_OUTTAB,
Internal table to hold Purchase Document Number *
T_EBELN LIKE STANDARD TABLE
OF FS_EBELN,
Internal table to hold Purchase Document Header *
T_EKKO LIKE STANDARD TABLE
OF FS_EKKO,
Temp Internal table to hold Purchase Document Header *
T_EKKO_TEMP LIKE STANDARD TABLE
OF FS_EKKO,
Internal table to hold Account number and Name of the Vendor *
T_LFA1 LIKE STANDARD TABLE
OF FS_LFA1,
Internal Table to hold Change date and the name of the user *
T_CDHDR LIKE STANDARD TABLE
OF FS_CDHDR,
Internal Table to hold Change document items *
T_CDPOS LIKE STANDARD TABLE
OF FS_CDPOS,
Temp. Internal Table to hold Change document items *
T_CDPOS_TEMP LIKE STANDARD TABLE
OF FS_CDPOS,
Internal Table to hold Data Element Name *
T_DATAELE LIKE STANDARD TABLE
OF FS_DATAELE,
Temp. Internal Table to hold Data Element Name *
T_DATAELE_TEMP LIKE STANDARD TABLE
OF FS_DATAELE,
Internal Table to hold Short Text of the Date Element *
T_TEXT LIKE STANDARD TABLE
OF FS_TEXT,
Internal Table to hold data to be displayed on the ALV grid *
T_OUTTAB LIKE STANDARD TABLE
OF FS_OUTTAB.
C L A S S D E F I N I T I O N *
CLASS LCL_EVENT_HANDLER DEFINITION DEFERRED.
*" Data declarations...................................................
Work variables *
DATA:
W_EBELN TYPE EKKO-EBELN, " Purchasing Document Number
W_LIFNR TYPE EKKO-LIFNR, " Vendor's account number
W_EKGRP TYPE EKKO-EKGRP, " Purchasing group
W_VALUE TYPE EKKO-EBELN, " Reflected Value
W_SPACE VALUE ' ', " Space
W_FLAG TYPE I, " Flag Variable
W_VARIANT TYPE DISVARIANT, " Variant
*--- ALV Grid
W_GRID TYPE REF TO CL_GUI_ALV_GRID,
*--- Event Handler
W_EVENT_CLICK TYPE REF TO LCL_EVENT_HANDLER,
*--- Field catalog table
T_FIELDCAT TYPE LVC_T_FCAT.
AT SELECTION-SCREEN EVENT *
AT SELECTION-SCREEN ON S_EBELN.
Subroutine to validate Purchase Document Number.
PERFORM VALIDATE_PD_NUM.
AT SELECTION-SCREEN ON S_LIFNR.
Subroutine to validate Vendor Number.
PERFORM VALIDATE_VEN_NUM.
AT SELECTION-SCREEN ON S_EKGRP.
Subroutine to validate Purchase Group.
PERFORM VALIDATE_PUR_GRP.
START-OF-SELECTION EVENT *
START-OF-SELECTION.
Subroutine to select all Purchase orders.
PERFORM SELECT_PO.
CHECK W_FLAG EQ 0.
Subroutine to select Object values.
PERFORM SELECT_OBJ_ID.
CHECK W_FLAG EQ 0.
Subroutine to select Changed values.
PERFORM SELECT_CHANGED_VALUE.
CHECK W_FLAG EQ 0.
Subroutine to Select Purchase Orders.
PERFORM SELECT_PUR_DOC.
Subroutine to select Vendor Details.
PERFORM SELECT_VENDOR.
Subroutine to select Text for the Changed values.
PERFORM DESCRIPTION.
END-OF-SELECTION EVENT *
END-OF-SELECTION.
IF NOT T_EKKO IS INITIAL.
Subroutine to populate the Output Table.
PERFORM FILL_OUTTAB.
Subroutine to build Field Catalog.
PERFORM PREPARE_FIELD_CATALOG CHANGING T_FIELDCAT.
CALL SCREEN 100.
ENDIF. " IF NOT T_EKKO...
CLASS LCL_EVENT_HANDLER DEFINITION
Defining Class which handles events
CLASS LCL_EVENT_HANDLER DEFINITION .
PUBLIC SECTION .
METHODS:
HANDLE_HOTSPOT_CLICK
FOR EVENT HOTSPOT_CLICK OF CL_GUI_ALV_GRID
IMPORTING E_ROW_ID E_COLUMN_ID.
ENDCLASS. " LCL_EVENT_HANDLER DEFINITION
CLASS LCL_EVENT_HANDLER IMPLEMENTATION
Implementing the Class which can handle events
CLASS LCL_EVENT_HANDLER IMPLEMENTATION .
*---Handle Double Click
METHOD HANDLE_HOTSPOT_CLICK .
Subroutine to get the HotSpot Cell information.
PERFORM GET_CELL_INFO.
SET PARAMETER ID 'BES' FIELD W_VALUE.
CALL TRANSACTION 'ME23N'.
ENDMETHOD. " HANDLE_HOTSPOT_CLICK
ENDCLASS. " LCL_EVENT_HANDLER
*& Module STATUS_0100 OUTPUT
PBO Event
MODULE STATUS_0100 OUTPUT.
SET PF-STATUS 'OOPS'.
SET TITLEBAR 'TIT'.
Subroutine to fill the Variant Structure
PERFORM FILL_VARIANT.
IF W_GRID IS INITIAL.
CREATE OBJECT W_GRID
EXPORTING
I_SHELLSTYLE = 0
I_LIFETIME =
I_PARENT = CL_GUI_CONTAINER=>SCREEN0
I_APPL_EVENTS =
I_PARENTDBG =
I_APPLOGPARENT =
I_GRAPHICSPARENT =
I_NAME =
I_FCAT_COMPLETE = SPACE
EXCEPTIONS
ERROR_CNTL_CREATE = 1
ERROR_CNTL_INIT = 2
ERROR_CNTL_LINK = 3
ERROR_DP_CREATE = 4
OTHERS = 5.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF. " IF SY-SUBRC <> 0
CALL METHOD W_GRID->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
I_BUFFER_ACTIVE =
I_BYPASSING_BUFFER =
I_CONSISTENCY_CHECK =
I_STRUCTURE_NAME =
IS_VARIANT = W_VARIANT
I_SAVE = 'A'
I_DEFAULT = 'X'
IS_LAYOUT =
IS_PRINT =
IT_SPECIAL_GROUPS =
IT_TOOLBAR_EXCLUDING =
IT_HYPERLINK =
IT_ALV_GRAPHICS =
IT_EXCEPT_QINFO =
IR_SALV_ADAPTER =
CHANGING
IT_OUTTAB = T_OUTTAB
IT_FIELDCATALOG = T_FIELDCAT
IT_SORT =
IT_FILTER =
EXCEPTIONS
INVALID_PARAMETER_COMBINATION = 1
PROGRAM_ERROR = 2
TOO_MANY_LINES = 3
OTHERS = 4
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF. " IF SY-SUBRC <> 0.
ENDIF. " IF W_GRID IS INITIAL
CREATE OBJECT W_EVENT_CLICK.
SET HANDLER W_EVENT_CLICK->HANDLE_HOTSPOT_CLICK FOR W_GRID.
ENDMODULE. " STATUS_0100 OUTPUT
*& Module USER_COMMAND_0100 INPUT
PAI Event
MODULE USER_COMMAND_0100 INPUT.
CASE SY-UCOMM.
WHEN 'BACK'.
LEAVE TO SCREEN 0.
WHEN 'EXIT'.
LEAVE PROGRAM.
WHEN 'CANCEL'.
LEAVE TO SCREEN 0.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
*& Form PREPARE_FIELD_CATALOG
Subroutine to build the Field catalog
<--P_T_FIELDCAT Field Catalog Table
FORM PREPARE_FIELD_CATALOG CHANGING PT_FIELDCAT TYPE LVC_T_FCAT .
DATA LS_FCAT TYPE LVC_S_FCAT.
Purchasing group...
LS_FCAT-FIELDNAME = 'EKGRP'.
LS_FCAT-REF_TABLE = 'EKKO'.
LS_FCAT-INTTYPE = 'C'.
LS_FCAT-OUTPUTLEN = '10'.
APPEND LS_FCAT TO PT_FIELDCAT.
CLEAR LS_FCAT.
Purchasing Document Number...
LS_FCAT-FIELDNAME = 'EBELN'.
LS_FCAT-REF_TABLE = 'EKKO' .
LS_FCAT-EMPHASIZE = 'C411'.
LS_FCAT-INTTYPE = 'C'.
LS_FCAT-OUTPUTLEN = '10'.
LS_FCAT-HOTSPOT = 'X'.
APPEND LS_FCAT TO PT_FIELDCAT .
CLEAR LS_FCAT .
Name of Person who Created the Object...
LS_FCAT-FIELDNAME = 'ERNAM'.
LS_FCAT-REF_TABLE = 'EKKO'.
LS_FCAT-OUTPUTLEN = '15' .
APPEND LS_FCAT TO PT_FIELDCAT.
CLEAR LS_FCAT.
Purchasing Document Date...
LS_FCAT-FIELDNAME = 'BEDAT'.
LS_FCAT-REF_TABLE = 'EKKO'.
LS_FCAT-INTTYPE = 'C'.
LS_FCAT-OUTPUTLEN = '10'.
APPEND LS_FCAT TO PT_FIELDCAT.
CLEAR LS_FCAT.
Vendor's account number...
LS_FCAT-FIELDNAME = 'LIFNR'.
LS_FCAT-REF_TABLE = 'EKKO'.
LS_FCAT-INTTYPE = 'C'.
LS_FCAT-OUTPUTLEN = '10'.
APPEND LS_FCAT TO PT_FIELDCAT.
CLEAR LS_FCAT.
Account Number of Vendor or Creditor...
LS_FCAT-FIELDNAME = 'NAME1'.
LS_FCAT-REF_TABLE = 'LFA1'.
LS_FCAT-INTTYPE = 'C'.
LS_FCAT-OUTPUTLEN = '10'.
LS_FCAT-COLTEXT = 'Vendor Name'(001).
LS_FCAT-SELTEXT = 'Vendor Name'(001).
APPEND LS_FCAT TO PT_FIELDCAT.
CLEAR LS_FCAT.
Creation date of the change document...
LS_FCAT-FIELDNAME = 'UDATE'.
LS_FCAT-REF_TABLE = 'CDHDR'.
LS_FCAT-INTTYPE = 'C'.
LS_FCAT-OUTPUTLEN = '10'.
LS_FCAT-COLTEXT = 'Change Date'(002).
LS_FCAT-SELTEXT = 'Change Date'(002).
APPEND LS_FCAT TO PT_FIELDCAT.
CLEAR LS_FCAT.
User name of the person responsible in change document...
LS_FCAT-FIELDNAME = 'USERNAME'.
LS_FCAT-REF_TABLE = 'CDHDR'.
LS_FCAT-INTTYPE = 'C'.
LS_FCAT-OUTPUTLEN = '10'.
LS_FCAT-COLTEXT = 'Modified by'(003).
LS_FCAT-SELTEXT = 'Modified by'(003).
APPEND LS_FCAT TO PT_FIELDCAT.
CLEAR LS_FCAT.
Short Text Describing R/3 Repository Objects...
LS_FCAT-FIELDNAME = 'DDTEXT'.
LS_FCAT-REF_TABLE = 'DD04T'.
LS_FCAT-INTTYPE = 'C'.
LS_FCAT-OUTPUTLEN = '15'.
APPEND LS_FCAT TO PT_FIELDCAT.
CLEAR LS_FCAT.
Old contents of changed field...
LS_FCAT-FIELDNAME = 'VALUE_OLD'.
LS_FCAT-REF_TABLE = 'CDPOS'.
LS_FCAT-INTTYPE = 'C'.
LS_FCAT-OUTPUTLEN = '12'.
APPEND LS_FCAT TO PT_FIELDCAT.
CLEAR LS_FCAT.
New contents of changed field...
LS_FCAT-FIELDNAME = 'VALUE_NEW'.
LS_FCAT-REF_TABLE = 'CDPOS'.
LS_FCAT-INTTYPE = 'C'.
LS_FCAT-OUTPUTLEN = '12'.
APPEND LS_FCAT TO PT_FIELDCAT.
CLEAR LS_FCAT.
ENDFORM. " PREPARE_FIELD_CATALOG
*& Form SELECT_PO
Subroutine to select all the Purchase Orders
There are no interface parameters to be passed to this subroutine.
FORM SELECT_PO .
SELECT EBELN " Purchasing Document Number
ERNAM " Name of Person who Created
" the Object
LIFNR " Vendor's account number
EKGRP " Purchasing group
BEDAT " Purchasing Document Date
FROM EKKO
PACKAGE SIZE 10000
APPENDING TABLE T_EBELN
WHERE EBELN IN S_EBELN
AND BEDAT IN S_BEDAT.
ENDSELECT.
IF SY-SUBRC NE 0.
W_FLAG = 1.
MESSAGE S401(M8).
ENDIF. " IF SY-SUBRC NE 0
ENDFORM. " SELECT_PO
*& Form SELECT_OBJ_ID
Subroutine to select Object ID
There are no interface parameters to be passed to this subroutine.
FORM SELECT_OBJ_ID .
IF NOT T_EBELN IS INITIAL.
SELECT OBJECTCLAS " Object Class
OBJECTID " Object value
CHANGENR " Document change number
USERNAME " User name
UDATE " Creation date
FROM CDHDR
INTO TABLE T_CDHDR
FOR ALL ENTRIES IN T_EBELN
WHERE OBJECTID EQ T_EBELN-EBELN
AND UDATE IN S_UDATE
AND TCODE IN ('ME21N','ME22N','ME23N').
ENDSELECT.
IF SY-SUBRC NE 0.
W_FLAG = 1.
MESSAGE S833(M8) WITH 'Header Not Found'(031).
ENDIF. " IF SY-SUBRC NE 0.
ENDIF. " IF NOT T_EBELN IS INITIAL
ENDFORM. " SELECT_OBJ_ID
*& Form SELECT_CHANGED_VALUE
Subroutine to select Changed Values
There are no interface parameters to be passed to this subroutine.
FORM SELECT_CHANGED_VALUE .
IF NOT T_CDHDR IS INITIAL.
SELECT OBJECTCLAS " Object class
OBJECTID " Object value
CHANGENR " Document change number
TABNAME " Table Name
FNAME " Field Name
VALUE_NEW " New contents of changed field
VALUE_OLD " Old contents of changed field
FROM CDPOS
PACKAGE SIZE 10000
APPENDING TABLE T_CDPOS
FOR ALL ENTRIES IN T_CDHDR
WHERE OBJECTCLAS EQ T_CDHDR-OBJECTCLAS
AND OBJECTID EQ T_CDHDR-OBJECTID
AND CHANGENR EQ T_CDHDR-CHANGENR.
ENDSELECT.
IF SY-SUBRC NE 0.
W_FLAG = 1.
MESSAGE S833(M8) WITH 'Item Not Found'(032).
ENDIF. " IF SY-SUBRC NE 0.
ENDIF. " IF NOT T_CDHDR IS INITIAL
T_CDPOS_TEMP[] = T_CDPOS[].
ENDFORM. " SELECT_CHANGED_VALUE
*& Form SELECT_PUR_DOC
Subroutine to select Purchase Order Details
There are no interface parameters to be passed to this subroutine.
FORM SELECT_PUR_DOC .
IF NOT T_CDPOS IS INITIAL.
SORT T_EBELN BY EBELN.
LOOP AT T_CDPOS INTO FS_CDPOS.
READ TABLE T_EBELN INTO FS_EBELN WITH KEY EBELN =
FS_CDPOS-OBJECTID BINARY SEARCH.
IF SY-SUBRC NE 0.
DELETE TABLE T_EBELN FROM FS_EBELN.
ENDIF. " IF SY-SUBRC NE 0.
ENDLOOP. " LOOP AT T_CDPOS...
LOOP AT T_EBELN INTO FS_EBELN.
MOVE FS_EBELN-EBELN TO FS_EKKO-EBELN.
MOVE FS_EBELN-ERNAM TO FS_EKKO-ERNAM.
MOVE FS_EBELN-LIFNR TO FS_EKKO-LIFNR.
MOVE FS_EBELN-EKGRP TO FS_EKKO-EKGRP.
MOVE FS_EBELN-BEDAT TO FS_EKKO-BEDAT.
APPEND FS_EKKO TO T_EKKO.
ENDLOOP. " LOOP AT T_EBELN...
T_EKKO_TEMP[] = T_EKKO[].
ENDIF. " IF NOT T_CDPOS IS INITIAL
ENDFORM. " SELECT_PUR_DOC
*& Form SELECT_VENDOR
Subroutine to select Vendor details
There are no interface parameters to be passed to this subroutine.
FORM SELECT_VENDOR .
IF NOT T_EKKO IS INITIAL.
SORT T_EKKO_TEMP BY LIFNR.
DELETE ADJACENT DUPLICATES FROM T_EKKO_TEMP COMPARING LIFNR.
SELECT LIFNR " Account Number of Vendor or
" Creditor
NAME1 " Name 1
FROM LFA1
INTO TABLE T_LFA1
FOR ALL ENTRIES IN T_EKKO_TEMP
WHERE LIFNR EQ T_EKKO_TEMP-LIFNR.
IF SY-SUBRC NE 0.
MESSAGE S002(M8) WITH 'Master Details'(033).
ENDIF. " IF SY-SUBRC NE 0.
ENDIF. " IF NOT T_EKKO IS INITIAL
ENDFORM. " SELECT_VENDOR
*& Form DESCRIPTION
Subroutine to get the description
There are no interface parameters to be passed to this subroutine.
FORM DESCRIPTION .
IF NOT T_CDPOS IS INITIAL.
SORT T_CDPOS_TEMP BY TABNAME FNAME.
DELETE ADJACENT DUPLICATES FROM T_CDPOS_TEMP COMPARING TABNAME FNAME
SELECT TABNAME " Table Name
FIELDNAME " Field Name
ROLLNAME " Data element
FROM DD03L
INTO TABLE T_DATAELE
FOR ALL ENTRIES IN T_CDPOS_TEMP
WHERE TABNAME EQ T_CDPOS_TEMP-TABNAME
AND FIELDNAME EQ T_CDPOS_TEMP-FNAME.
IF NOT T_DATAELE IS INITIAL.
T_DATAELE_TEMP[] = T_DATAELE[].
SORT T_DATAELE_TEMP BY ROLLNAME.
DELETE ADJACENT DUPLICATES FROM T_DATAELE_TEMP COMPARING ROLLNAME.
SELECT ROLLNAME " Data element
DDTEXT " Short Text Describing R/3
" Repository Objects
FROM DD04T
INTO TABLE T_TEXT
FOR ALL ENTRIES IN T_DATAELE_TEMP
WHERE ROLLNAME EQ T_DATAELE_TEMP-ROLLNAME
AND DDLANGUAGE EQ SY-LANGU.
IF SY-SUBRC NE 0.
EXIT.
ENDIF. " IF SY-SUBRC NE 0.
ENDIF. " IF NOT T_DATAELE IS INITIAL.
ENDIF. " IF NOT T_CDPOS IS INITIAL.
ENDFORM. " DESCRIPTION
*& Form FILL_OUTTAB
Subroutine to populate the Outtab
There are no interface parameters to be passed to this subroutine.
FORM FILL_OUTTAB .
SORT T_CDHDR BY OBJECTCLAS OBJECTID CHANGENR.
SORT T_EKKO BY EBELN.
SORT T_LFA1 BY LIFNR.
SORT T_DATAELE BY TABNAME FIELDNAME.
SORT T_TEXT BY ROLLNAME.
LOOP AT T_CDPOS INTO FS_CDPOS.
READ TABLE T_CDHDR INTO FS_CDHDR WITH KEY
OBJECTCLAS = FS_CDPOS-OBJECTCLAS
OBJECTID = FS_CDPOS-OBJECTID
CHANGENR = FS_CDPOS-CHANGENR
BINARY SEARCH.
IF SY-SUBRC EQ 0.
MOVE FS_CDHDR-USERNAME TO FS_OUTTAB-USERNAME.
MOVE FS_CDHDR-UDATE TO FS_OUTTAB-UDATE.
READ TABLE T_EKKO INTO FS_EKKO WITH KEY
EBELN = FS_CDHDR-OBJECTID
BINARY SEARCH.
IF SY-SUBRC EQ 0.
MOVE FS_EKKO-EBELN TO FS_OUTTAB-EBELN.
MOVE FS_EKKO-ERNAM TO FS_OUTTAB-ERNAM.
MOVE FS_EKKO-LIFNR TO FS_OUTTAB-LIFNR.
MOVE FS_EKKO-EKGRP TO FS_OUTTAB-EKGRP.
MOVE FS_EKKO-BEDAT TO FS_OUTTAB-BEDAT.
READ TABLE T_LFA1 INTO FS_LFA1 WITH KEY
LIFNR = FS_EKKO-LIFNR
BINARY SEARCH.
IF SY-SUBRC EQ 0.
MOVE FS_LFA1-NAME1 TO FS_OUTTAB-NAME1.
ENDIF. " IF SY-SUBRC EQ 0.
ENDIF. " IF SY-SUBRC EQ 0.
ENDIF. " IF SY-SUBRC EQ 0.
MOVE FS_CDPOS-VALUE_NEW TO FS_OUTTAB-VALUE_NEW.
MOVE FS_CDPOS-VALUE_OLD TO FS_OUTTAB-VALUE_OLD.
READ TABLE T_DATAELE INTO FS_DATAELE WITH KEY
TABNAME = FS_CDPOS-TABNAME
FIELDNAME = FS_CDPOS-FNAME
BINARY SEARCH.
IF SY-SUBRC EQ 0.
READ TABLE T_TEXT INTO FS_TEXT WITH KEY
ROLLNAME = FS_DATAELE-ROLLNAME
BINARY SEARCH.
IF SY-SUBRC EQ 0.
MOVE FS_TEXT-DDTEXT TO FS_OUTTAB-DDTEXT.
ENDIF. " IF SY-SUBRC EQ 0.
ENDIF. " IF SY-SUBRC EQ 0.
APPEND FS_OUTTAB TO T_OUTTAB.
CLEAR FS_OUTTAB.
ENDLOOP.
ENDFORM. " FILL_OUTTAB
*& Form GET_CELL_INFO
Subroutine to get the Cell Information
--> W_VALUE Holds the value of Hotspot clicked
FORM GET_CELL_INFO .
CALL METHOD W_GRID->GET_CURRENT_CELL
IMPORTING
E_ROW =
E_VALUE = W_VALUE
E_COL =
ES_ROW_ID =
ES_COL_ID =
ES_ROW_NO =
ENDFORM. " GET_CELL_INFO
*& Form VALIDATE_PD_NUM
Subroutine to validate Purchase Document Number
There are no interface parameters to be passed to this subroutine.
FORM VALIDATE_PD_NUM .
IF NOT S_EBELN[] IS INITIAL.
SELECT EBELN " Purchase Document Number
FROM EKKO
INTO W_EBELN
UP TO 1 ROWS
WHERE EBELN IN S_EBELN.
ENDSELECT.
IF SY-SUBRC NE 0.
CLEAR SSCRFIELDS-UCOMM.
MESSAGE E717(M8).
ENDIF. " IF SY-SUBRC NE 0
ENDIF. " IF NOT S_EBELN[]...
ENDFORM. " VALIDATE_PD_NUM
*& Form VALIDATE_VEN_NUM
Subroutine to validate Vendor Number
There are no interface parameters to be passed to this subroutine.
FORM VALIDATE_VEN_NUM .
IF NOT S_LIFNR[] IS INITIAL.
SELECT LIFNR " Vendor Number
FROM LFA1
INTO W_LIFNR
UP TO 1 ROWS
WHERE LIFNR IN S_LIFNR.
ENDSELECT.
IF SY-SUBRC NE 0.
CLEAR SSCRFIELDS-UCOMM.
MESSAGE E002(M8) WITH W_SPACE.
ENDIF. " IF SY-SUBRC NE 0
ENDIF. " IF NOT S_LIFNR[]...
ENDFORM. " VALIDATE_VEN_NUM
*& Form VALIDATE_PUR_GRP
Subroutine to validate the Purchase Group
There are no interface parameters to be passed to this subroutine.
FORM VALIDATE_PUR_GRP .
IF NOT S_EKGRP[] IS INITIAL.
SELECT EKGRP " Purchase Group
FROM T024
INTO W_EKGRP
UP TO 1 ROWS
WHERE EKGRP IN S_EKGRP.
ENDSELECT.
IF SY-SUBRC NE 0.
CLEAR SSCRFIELDS-UCOMM.
MESSAGE E622(M8) WITH W_SPACE.
ENDIF. " IF SY-SUBRC NE 0
ENDIF. " IF NOT S_EKFRP[]...
ENDFORM. " VALIDATE_PUR_GRP
*& Form FILL_VARIANT
Subroutine to fill the Variant Structure
There are no interface parameters to be passed to this subroutine
FORM FILL_VARIANT .
Filling the Variant structure
W_VARIANT-REPORT = SY-REPID.
W_VARIANT-USERNAME = SY-UNAME.
ENDFORM. " FILL_VARIANT
<b>Reward if usefull</b> -
Hi,
i have a dimension table with month_key having values (201201,201202,201203.......202011,202012) and month name ( Jan 12, feb 12,......NOV 20, Dec 20) and a fact table with columns (month_key ,measure_types, Amount)
My requirement is to create a power pivot report in which when a user select a month from the filter, the report should display the (selected month+18 ) month's data against each type . when JAN 12 is selected ,the jan 2012 +18 = june 2013
, month name should be populated with months till june 2013 only .
i tried creating calculated column"END DATE " in the fact table with dax expression to calculate the 18th monh from the current month as below
month_key END DATE
201201 201306
201202 201307
and thought of filtering the table with month key <= ENDDATE but it is not working as expected. could you please guide me on this ? Is there any time intelligence function that serve the purpose . Iam using excel 2010
..hence could not do any calculation on the report side also. please suggest .
Thanks in advanceDo you need to show the measure calculated for those 18 months as a total on 1 row, or do you need to select a single month and then display on row filters 18 distinct rows?
The first is trivial as driezl has suggested.
The second will require a second calendar table.
I created this example workbook for a coworker who had a similar problem. You will have to use the disconnected table as your filter and pull your related table onto the rows.
Finally, the easiest way to deal with the sort of date arithmetic you need to do is to restructure your date table to have a series of "Sequential" fields. These fields should be the number of units of time since the beginning of your calendar.
For example, consider a calendar starting on January 1, 2010. For January - December 2010, [MonthSequential] = 1, 2, ..., 12. For January - December 2011, [MonthSequential] = 13, 14, ..., 24, and so on, incrementing by 1 for each sequential month in time.
Assuming you have this set up in your date tables (one related to your model - DimDate - and one disconnected - DisconDimDate) your measure would look like this:
18 Month Measure:=
CALCULATE( [Measure]
, FILTER( DimDate
, DimDate[MonthSequential] >= MAX( DisconDimDate[MonthSequential] )
&& DimDate[MonthSequential] <= MAX( DisconDimDate[MonthSequential] ) + 18
Please review this example along with the workbook I have linked above. -
Is ther any std report to know the overdue purchase order?
Hi,
Is ther any std report to know the overdue purchase order based on the delivery date.
regards,
vimalhi,
I don't think there is any report for your requirement...Pls contact ABAPer for the requirement...and refer the following reports and tables:
reports: ME2N/ME2M/ME2L
tables : EKET: delivery schedules for PO...
Regards
Priyanka.P -
Standard Report for missing parts at production order operation level?
Hi PP Gurus,
We have standard report for missing parts at production orders level.
For our client, they need a report for missing parts analysis at production order operation level. Do we have any such standard report in the SAP?
Please help.
Thanks,
Reddy.Hi Arvind,
Thanks for for your response.
1. List: Components, Layout: Standard layout set the Missing part
It shows the component requirement/withdrawn quantity for each operation of production order. It is not showing the commit quantity.
2. List: Components, Layout: Pick list set the Missing part
It shows the component requirement/withdrawn quantity for each production order.
3. List: Components, Layout: Missing Parts List-Material View set the Missing part
It shows the component requirement/commit quantity for each production order. It is not showing the commit quantity at opertion level.
4. List: Components, Layout: Missing Parts List-Order View set the Missing part
It shows the component requirement/commit quantity for each production order. It is not showing the commit quantity at opertion level.
We are unable to get the solution from all these 1 to 4 reports from COOIS.
Do we have any option to change the existing layout (ex: 3 ) to get the commit quantity for operation with missing parts indicator?
If avilable, what is the procedure to be followed?
Thanks,
Reddy. -
Report to see the Blocked Sales orders
Hi friends,
Is there any standard report to view the Blocked Sales orders in SAP.
Please help me out.
Thanks in Advance,
Regards,
Anvita.Hi Anvitha,
You can try one of the following transactions:
VE31 Blocked SD Documents
VKM1 Blocked SD Documents
V.14 Sales Orders Blocked for Delivery
V23 Sales Documents Blocked for Billing
VA14L Sales Documents Blocked for Delivery
Cheers,
Bhanu -
Cost Analysis Report - For a range of process orders
Dear all,
Is there a standard report available to get the cost analysis for a range of process order? COR3 --> Go to --> Cost --> Analysis. Here I can see the cost analysis for one report. But I wanted to get the cost analysis report for a range of process orders. Please help.
Thanks
NagarajanDear
You can use cost analysis report like
1.S_ALR_87099932 - Variances Between Costing Runs
2.S_ALR_87099931 - Price vs Cost Estimate
3.S_ALR_87099932 - Variances Between Costing Runs
5.KOC4
Regards
JH -
T-code/Report for seeing the existing entire GL master data
Dear Experts,
Is there any t-code/Report for seeing the existing entire GL master data at chart of accounts level and company code level.
example :
GL a/c no company_code account_group shrt_text long_text tax_category open_item_management etc
172500 1000 Balance sheet tds pay tds payable * X
Thanks in Advance
Regards,
T.Kartheek
Moderator: Please, search before postingDear expert
you can use f.10 or f.08
2. GL Account Balances (Totals & Balances ) S_ALR_87012301
3. GL Line Items S_ALR_87012282
4.Display of Changed Documents S_ALR_87012293
5. Chart of Accounts S_AL:R_87012326
6.. GL Account List S_AL:R_87012328
7.. Display Changes to GL Accounts S_ALR_87012308
Regards
Ajeesh.s
Edited b -
Function module for deleting the perticular sales order
Hi Experts
I wanted a function module name for deleting the perticular sales order document ,when i enter the import parameter as sales order no and some value as export parameters so that i can use that for the program (message :successfully deleted ).Hi Satya,
Use BAPI BAPI_SALESORDER_CHANGE as follows:
DATA: T_RETURN LIKE BAPIRET2 OCCURS 0 WITH HEADER LINE.
DATA: BAPISDH1X LIKE BAPISDH1X.
PARAMETERS: P_VBELN LIKE VBAK-VBELN.
*SET THE DELETION FLAG
BAPISDH1X-UPDATEFLAG = 'D'.
CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
EXPORTING
salesdocument = P_VBELN
order_header_inx = BAPISDH1X
tables
return = T_RETURN
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
Hope this will help.
Regards,
Nitin.
Edited by: Nitin Karamchandani on Dec 8, 2008 8:36 AM
Maybe you are looking for
-
I have added a 5 songs from a single album and in Ipod it comes as enigma album and in that one song is available and another album named enigma and another song. IT happens for 5 songs also. How to make all the 5 songs in one album name Enigma???
-
User should not be able to cancel Proforma invoice if Excise Invoice Exist
Dear All , I have a requirement that i have a performa invoice for which a excise invoice is created and then when i go to VF02 and check on Complete the i want to check whether the exicise invoice is cancelled or not . Can Anybody h
-
When I create files in Adobe Illustrator, Photoshop, and Indesign if the design includes gradients and I save or export it as a pdf for print, whenever I have the file printed the gradients often come out with lines and streaks in the print. I usuall
-
Time Machine operates, but no changes are recorded in the backups.
Time Machine appears to make a backup each hour, and a new backup file is written. No error messages are produced. However, each new backup file appears to be exactly the same as the previous one. Using the "Get Info" function of the Finder, I ca
-
New NIS Installation on a Veritas Cluster
I am getting the following error after running the following command: #ypinit -m Can't get local host's domain name. Please check your path. Any ideas ? Everything seems to look ok.