5
1/30/2015 Displaying ALV in Splitter Container with heading using ABAP OO http://sapuniversity.eu/displayingalvinsplittercontainerwithheadingusingooabap/ 1/5 Home About Us SAP TRAINING Authors Become an Author Other SAP Resources Contact Home About Us SAP TRAINING Authors Become an Author Other SAP Resources Contact Home » SAP ABAP » Displaying ALV in Splitter Container with heading using ABAP OO Displaying ALV in Splitter Container with heading using ABAP OO 7 December 2012 | Avinash Palavai | 3 Comments | SAP ABAP Introduction: Splitter Container can be used to display data either from two or more tables or from a single table based on particular conditions in ALV format using a single container at a time. The classes that are used for achieving this are as follows, 1. CL_GUI_CUSTOM_CONTAINER . 2. CL_GUI_SPLITTER_CONTAINER . 3. CL_GUI_CONTAINER . 4. CL_GUI_ALV_GRID . 5. CL_DD_DOCUMENT. Procedure: 1. First we have to design a modulepool screen (Screen No.100 ) with two custom controls, each for ALV and Heading as below, 1. Name the first control as "HEADING". Loading > Categories Geen categorie SAP CRM SAP basic knowledge SAP SD SAP FICO SAP HCM SAP BW /BI SAP Authorizations SAP ABAP SAP BASIS SAP Career SAP Workflow Disclaimer SAPUNIVERSITY.EU is not affiliated or related to any division or subsidiary of SAP® AG. SAP, SAP R/3, R/3 software, R/2 software, ABAP/4 programming language, BAPI programming interface, BWI software, AcceleratedSAP methodology, and and any other SAP trademarks are registered trademarks of SAP AG Send me Weekly Updates! First Name E-mail Sign Me Up Now!

Displaying ALV in Splitter Container With Heading Using ABAP OO

Embed Size (px)

DESCRIPTION

alv oops splitter container

Citation preview

  • 1/30/2015 DisplayingALVinSplitterContainerwithheadingusingABAPOO

    http://sapuniversity.eu/displayingalvinsplittercontainerwithheadingusingooabap/ 1/5

    Home AboutUs SAPTRAINING Authors BecomeanAuthor OtherSAPResources Contact

    Home AboutUs SAPTRAINING Authors BecomeanAuthor OtherSAPResources Contact

    HomeSAPABAPDisplayingALVinSplitterContainerwithheadingusingABAPOO

    Displaying ALV in Splitter Container withheading using ABAP OO

    7December2012| AvinashPalavai| 3Comments| SAPABAP

    Introduction:

    SplitterContainercanbeusedtodisplaydataeitherfromtwoormoretablesorfromasingletablebasedonparticularconditionsinALVformatusingasinglecontaineratatime.

    Theclassesthatareusedforachievingthisareasfollows,

    1. CL_GUI_CUSTOM_CONTAINER.2. CL_GUI_SPLITTER_CONTAINER.3. CL_GUI_CONTAINER.4. CL_GUI_ALV_GRID.5. CL_DD_DOCUMENT.

    Procedure:

    1. Firstwehavetodesignamodulepoolscreen(ScreenNo.100)withtwocustomcontrols,eachforALVandHeadingasbelow,

    1. Namethefirstcontrolas"HEADING".

    Loading

    >

    Categories

    GeencategorieSAPCRMSAPbasicknowledgeSAPSDSAPFICOSAPHCMSAPBW/BISAPAuthorizationsSAPABAPSAPBASISSAPCareerSAPWorkflow

    Disclaimer

    SAPUNIVERSITY.EUisnotaffiliatedorrelatedtoanydivisionorsubsidiaryofSAPAG.

    SAP,SAPR/3,R/3software,R/2software,ABAP/4programminglanguage,BAPIprogramminginterface,BWIsoftware,AcceleratedSAPmethodology,andandanyotherSAPtrademarksareregisteredtrademarksofSAPAG

    Send me Weekly Updates!First Name

    E-mail

    SignMeUpNow!

  • 1/30/2015 DisplayingALVinSplitterContainerwithheadingusingABAPOO

    http://sapuniversity.eu/displayingalvinsplittercontainerwithheadingusingooabap/ 2/5

    2. Namethesecondcontrolas"MAIN_CONT".3. Saveandactivatethescreen.4. Dothebelowcodinginthereportprogram.5. HereitookacaseofdisplayingthematerialdetailsofaparticularmaterialtypeZSEM',in

    theparentsplitalvlistandthedescriptionsofthosematerialsthatarelistedinparentsplitalvinchildsplitalv.

    6. TheheadingbeingmaintainedforthisALVis'MaterialMasterReport'.*****************************Coding*********************************REPORTZOOALV_WITH_SPLITTER.DATA:O_CCTYPEREFTOCL_GUI_CUSTOM_CONTAINER.DATA:O_SCTYPEREFTOCL_GUI_SPLITTER_CONTAINER.DATA:O_PART1TYPEREFTOCL_GUI_CONTAINER.DATA:O_PART2TYPEREFTOCL_GUI_CONTAINER.DATA:ALV_GRID1TYPEREFTOCL_GUI_ALV_GRID.DATA:ALV_GRID2TYPEREFTOCL_GUI_ALV_GRID.DATA:I_MARATYPETABLEOFMARA.DATA:I_MAKTTYPETABLEOFMAKT.DATA:DDTYPEREFTOCL_DD_DOCUMENT.

    STARTOFSELECTION.

    callSCREEN100.

    *&**&ModuleSTATUS_0100OUTPUT*&*

  • 1/30/2015 DisplayingALVinSplitterContainerwithheadingusingABAPOO

    http://sapuniversity.eu/displayingalvinsplittercontainerwithheadingusingooabap/ 3/5

    *text**MODULESTATUS_0100OUTPUT.*SETPFSTATUS'xxxxxxxx'.*SETTITLEBAR'xxx'.PERFORMcreate_objects.PERFORMspli_main_cont.PERFORMDISP_HEADING.PERFORMdisp_alv1.PERFORMdisp_alv2.ENDMODULE."STATUS_0100OUTPUT*&**&FormCREATE_OBJECTS*&**text***>p1text*p1text*GET_CONTAINEREXPORTINGROW=1COLUMN=1RECEIVINGCONTAINER=O_PART1.

    CALLMETHODO_SC>GET_CONTAINEREXPORTINGROW=2COLUMN=1RECEIVINGCONTAINER=O_PART2.ENDFORM."SPLI_MAIN_CONT

    *&**&FormDISP_ALV1*&**text***>p1text*SET_TABLE_FOR_FIRST_DISPLAYEXPORTINGI_STRUCTURE_NAME='MARA'CHANGINGIT_OUTTAB=I_MARA.ENDFORM."DISP_ALV1

    *&**&FormDISP_ALV2*&**text***>p1text*SET_TABLE_FOR_FIRST_DISPLAYEXPORTINGI_STRUCTURE_NAME='MAKT'CHANGINGIT_OUTTAB=I_MAKT.

    ENDFORM."DISP_ALV2

    *&**&FormDISP_HEADING*&**text***>p1text*HEADING.CALLMETHODDD>ADD_TEXTEXPORTINGTEXT='MATERIALMASTERREPORT'SAP_STYLE=HEAD.

    CALLMETHODDD>DISPLAY_DOCUMENTEXPORTINGCONTAINER='HEADING'.

  • 1/30/2015 DisplayingALVinSplitterContainerwithheadingusingABAPOO

    http://sapuniversity.eu/displayingalvinsplittercontainerwithheadingusingooabap/ 4/5

    ENDFORM."DISP_LOGO

    7. Saveandactivatetheentireprogram.Execute(F8),

    8. TheresultclearlyillustratesthepurposeandadvantageofdisplayingtheALVinSplitterContainer.

    AvinashPalavai,SAPTechnicalConsultant,StraVisITSolutions.MoreaboutAvinashPalavai

    Tweet

    0 0

    3 thoughts on Displaying ALV in Splitter Container withheading using ABAP OO

    Leave a Reply

    Name*

    Email*

    Share

    0

    Facebooksocialplugin

    Addacomment...

    Commentusing...

    By MOHIT on 26 November 2013 at 11:49

    Kindlyreviewhecodeyouhavgiven..willitworkinanycase..waitingfortheupdatedone..

    Comment

    By Avinash Palavai on 27 November 2013 at 04:23

    Thatisaworkingcode,andwillwork....

    Comment

    By Rafa on 18 December 2013 at 20:18

    Noworkingcode.Pleaseupdate.

    Comment

  • 1/30/2015 DisplayingALVinSplitterContainerwithheadingusingABAPOO

    http://sapuniversity.eu/displayingalvinsplittercontainerwithheadingusingooabap/ 5/5

    Comment

    PostComment

    Home AboutUs SAPTRAINING Authors BecomeanAuthor OtherSAPResources Contact