Вы находитесь на странице: 1из 4

07/12/2014

AnSAPConsultant:ABAPHierarchicalSequenceListinALV

An SAP Consultant
HOME

ABAP

ALV

SMART FORMS

ADOBE FORMS

HR ABAP

WORKFLOW

WEB DYNPRO ABAP

Monday, December 20, 2010

ABAP Hierarchical Sequence List in ALV


Hierarchical display is used for displaying data that are related. Like sales order and item details. Here sales order
details can be the header data whereas them items in the sales order can be the item data.

HCM

Follow by Email
Emailaddress...

FindusonFacebook

AnSAPConsultant

Function module REUSE_ALV_HIERSEQ_LIST_DISPLAY

Like

I_tabname_header : Name of the internal table in the program containing the output data of the highest
684peoplelikeAnSAPConsultant.

hierarchy level.
I_tabname_item : Name of the internal table in the program containing the output data of the lowest hierarchy
level.
Is_keyinfo : This structure contains the header and item table field names which link the two tables (shared key).

Tables
t_outtab_header : Header table with data to be output
t_outtab_item : Name of the internal table in the program containing the output data of the lowest hierarchy
level.

REPORTztest_notepad.
TABLES:
ekko,ekpo.
TYPEPOOLS:
slis.
SELECTIONSCREENBEGINOFBLOCKb1WITHFRAMETITLEtext001.
SELECTOPTIONS:
so_ekorgFORekkoekorg,
so_ebelnFORekkoebeln,
so_aedatFORekkoaedat.
PARAMETERS:r1RADIOBUTTONGROUPrad1,
r2RADIOBUTTONGROUPrad1,
r3RADIOBUTTONGROUPrad1.
SELECTIONSCREENENDOFBLOCKb1.
TYPES:
BEGINOFty_ekko,
ebelnTYPEekkoebeln,
ekorgTYPEekkoekorg,
aedatTYPEekkoaedat,
lifnrTYPEekkolifnr,
ENDOFty_ekko.
TYPES:
BEGINOFty_ekpo,
ebelnTYPEekkoebeln,"Change
ebelpTYPEekpoebelp,
matnrTYPEekpomatnr,
werksTYPEekpowerks,
txz01TYPEekpotxz01,
mengeTYPEekpomenge,
ENDOFty_ekpo.
DATA:it_ekpoTYPETABLEOFty_ekpo,
wa_ekpoTYPEty_ekpo.
DATA:it_ekkoTYPETABLEOFty_ekko,
wa_ekkoTYPEty_ekko.
http://www.ansapconsultant.com/2010/12/abaphierarchicalsequencelistinalv.html

Facebooksocialplugin

Followers
Jointhissite
withGoogleFriendConnect

Members(37) More

Alreadyamember?Signin

Popular Posts
1

ABAPALVReportexamplewithsteps

ExecuteABAPReportusingSUBMIT
statement

WebDynproABAPALVON_CLICKevent

ABAPSendingemailwithpdfattachment

ABAPDynamicWHEREclause

ABAPDownloadreportoutputasPDFfile

ABAPALVDemoprograms

ABAPBinarytoString,StringtoXSTRING,
StringtoBinary

WebdynproabapError/Successmessage
sampleprogram

10

WebDynproABAPDownloadfile

1/4

07/12/2014

AnSAPConsultant:ABAPHierarchicalSequenceListinALV

DATA:
it_fcatTYPEslis_t_fieldcat_alv,
wa_fcatTYPEslis_fieldcat_alv.
DATA:
repidLIKEsyrepidVALUEsyrepid,
keyTYPEslis_keyinfo_alv.
DATA:
g_ekkoTYPEslis_tabnameVALUE'IT_EKKO',g_ekpo
TYPE
slis_tabnameVALUE'IT_EKPO'.

Websites I follow

STARTOFSELECTION.
PERFORMget_data.
PERFORMfield_cat.
PERFORMfm_hir_dis.
*&*
*&FormGET_DATA
*&*
*text
**
*>p1text*<p2text
**
FORMget_data.
SELECTebelnekorgaedatlifnr
FROMekko
INTOTABLEit_ekko
WHEREekorgINso_ekorg
ANDebelnINso_ebeln
ANDaedatINso_aedat.

Web Dynpro ABAP Book

HTML/CSS/Javscript Generator
Easy CSS3 Generator
Digital Inspiration
Shout ME Loud
Twitter Feed

SELECTebelnebelpmatnrwerkstxz01menge
FROMekpo
INTOTABLEit_ekpo
FORALLENTRIESINit_ekko
WHEREebeln=it_ekkoebeln.
ENDFORM."get_data
"GET_DATA
*&*
*&FormFIELD_CAT
*&*
*text
**
*>p1text*<p2text
**
FORMfield_cat.
CLEARwa_fcat.
wa_fcattabname='IT_EKKO'.
wa_fcatfieldname='EBELN'.
wa_fcatseltext_l='POORDERNUMBER'.
APPENDwa_fcatTOit_fcat.
CLEARwa_fcat.
wa_fcattabname='IT_EKKO'.
wa_fcatfieldname='EKORG'.
wa_fcatseltext_l='POORG'.
APPENDwa_fcatTOit_fcat.
CLEARwa_fcat.
wa_fcattabname='IT_EKKO'.
wa_fcatfieldname='AEDAT'.
wa_fcatseltext_l='DATE'.
APPENDwa_fcatTOit_fcat.
CLEARwa_fcat.
wa_fcattabname='IT_EKKO'.
wa_fcatfieldname='LIFNR'.
wa_fcatseltext_l='VENDOR'.
APPENDwa_fcatTOit_fcat.
CLEARwa_fcat.

http://www.ansapconsultant.com/2010/12/abaphierarchicalsequencelistinalv.html

2/4

07/12/2014

AnSAPConsultant:ABAPHierarchicalSequenceListinALV

wa_fcattabname='IT_EKPO'.
wa_fcatfieldname='EBELP'.
wa_fcatseltext_l='ITEMS'.
APPENDwa_fcatTOit_fcat.
CLEARwa_fcat.
wa_fcattabname='IT_EKPO'.
wa_fcatfieldname='MATNR'.
wa_fcatseltext_l='MATERIAL'.
APPENDwa_fcatTOit_fcat.
CLEARwa_fcat.
wa_fcattabname='IT_EKPO'.
wa_fcatfieldname='WERKS'.
wa_fcatseltext_l='PLANT'.
APPENDwa_fcatTOit_fcat.
CLEARwa_fcat.
wa_fcattabname='IT_EKPO'.
wa_fcatfieldname='TXZ01'.
wa_fcatseltext_l='SHORTTEXT'.
APPENDwa_fcatTOit_fcat.
CLEARwa_fcat.
wa_fcattabname='IT_EKPO'.
wa_fcatfieldname='MENGE'.
wa_fcatseltext_l='QUANTITY'.
APPENDwa_fcatTOit_fcat.
CLEARwa_fcat.
ENDFORM."FIELD_CAT
*&*
*&FormFM_HIR_DIS
*&*
*text
**
*>p1text*<p2text
**
FORMfm_hir_dis.
keyheader01='EBELN'.
keyitem01='EBELN'.
CALLFUNCTION'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
EXPORTING
i_callback_program=repid
it_fieldcat=it_fcat
i_tabname_header='IT_EKKO'
i_tabname_item='IT_EKPO'
is_keyinfo=key
TABLES
t_outtab_header=it_ekko
t_outtab_item=it_ekpo.
ENDFORM."fm_hir_dis
."FM_HIR_DIS

Recommend this on Google

http://www.ansapconsultant.com/2010/12/abaphierarchicalsequencelistinalv.html

3/4

07/12/2014

AnSAPConsultant:ABAPHierarchicalSequenceListinALV

1 comment:
Pankaj Sharma June 28, 2014 at 10:52 AM
useful. thank you very much..
Reply

Enteryourcomment...

Commentas:

GoogleAccount

Publish

Preview

Your useful comments, suggestions are appreciated.Your comments are moderated.

An SAP Consultant
Contact US
About US

Follow US
Facebook
Twitter

Privacy Policy

Want to Contribute ?
If you are interested in writing about the new stuff
you learn everyday while working, please write to
the.sap.consultants@gmail.com.

Google

Click on Contribution for more details.

2014ansapconsultant.comAllrightsreserved.

http://www.ansapconsultant.com/2010/12/abaphierarchicalsequencelistinalv.html

4/4

Вам также может понравиться