ALV文挡.docx

上传人:b****3 文档编号:3457340 上传时间:2022-11-23 格式:DOCX 页数:47 大小:225.43KB
下载 相关 举报
ALV文挡.docx_第1页
第1页 / 共47页
ALV文挡.docx_第2页
第2页 / 共47页
ALV文挡.docx_第3页
第3页 / 共47页
ALV文挡.docx_第4页
第4页 / 共47页
ALV文挡.docx_第5页
第5页 / 共47页
点击查看更多>>
下载资源
资源描述

ALV文挡.docx

《ALV文挡.docx》由会员分享,可在线阅读,更多相关《ALV文挡.docx(47页珍藏版)》请在冰豆网上搜索。

ALV文挡.docx

ALV文挡

ALV(ABAPLISTVIEWER)

SapprovidesasetofALV(ABAPLISTVIEWER)functionmodules,whichcanbeputintousetoembellishtheoutputofareport.ThissetofALVfunctionsisusedtoenhancethereadabilityandfunctionalityofanyreportoutput.Casesariseinsapwhentheoutputofareportcontainscolumnsextendingmorethan255charactersinlength.Insuchcases,thissetofALVfunctionscanhelpchooseselectedcolumnsandarrangethedifferentcolumnsfromareportoutputandalsosavedifferentvariantsforreportdisplay.Thisisaveryefficienttoolfordynamicallysortingandarrangingthecolumnsfromareportoutput.Thereportoutputcancontainupto90columnsinthedisplaywiththewidearrayofdisplayoptions.

ThecommonlyusedALVfunctionsusedforthispurposeare;

1.REUSE_ALV_VARIANT_DEFAULT_GET

2.REUSE_ALV_VARIANT_F4

3.REUSE_ALV_VARIANT_EXISTENCE

4.REUSE_ALV_EVENTS_GET

5.REUSE_ALV_COMMENTARY_WRITE

6.REUSE_ALV_FIELDCATALOG_MERGE

7.REUSE_ALV_LIST_DISPLAY

8.REUSE_ALV_GRID_DISPLAY

9.REUSE_ALV_POPUP_TO_SELECT

 

Thedifferentstepsusedforgettingtheabovefunctionmodulesintouseare:

Step1

DATADECLARATION

Sapstandardtypepools:

SLIS,KKBLO.

Sapstandardtablestypestakenfromthetypepoolsare:

SLIS_LAYOUT_ALV,

SLIS_T_FIELDCAT_ALV,

SLIS_T_LISTHEADER,

SLIS_T_EVENT,

SLIS_SELFIELD.

Internaltablestousedintheprogramdeclaredbasedontheabovetabletypes

DATA:

I_LAYOUTTYPESLIS_LAYOUT_ALV,

I_FIELDTABTYPESLIS_T_FIELDCAT_ALV,

I_HEADINGTYPESLIS_T_LISTHEADER,

I_EVENTSTYPESLIS_T_EVENT.

TYPES:

KKBLO_SELFIELDTYPESLIS_SELFIELD.

 

Step2(Optional)

SELECTINGTHEVARIANTSFORINITIALLISTDISPLAY(DEFAULTVARIANT)

Thevariantsinthelistdisplaycanbebothuser-specificandgeneral.Theusercanprogrammaticallysettheinitial(default)variantforlistdisplay.

Thedefaultvariantcanbefoundusingthefunctionmodule'REUSE_ALV_VARIANT_DEFAULT_GET'.

Samplecode:

CALLFUNCTION'REUSE_ALV_VARIANT_DEFAULT_GET'

EXPORTING

i_save=variantsavecondition(A=all,U=user-specific)

CHANGING

cs_variant=internaltablecontainingtheprogramname(andthedefaultvariant---optional)

EXCEPTIONS

not_found=2.

Theusercanalsochoosefromthelistofexistingvariantsusingthefunctionmodule‘REUSE_ALV_VARIANT_F4’.

Step3

DEFINININGOUTPUTCHARACTERISTICS:

PREPARINGDISPLAYFIELDSCATALOG

Afieldcatalogispreparedusingtheinternaltable(I_FIELDCAT)oftypeSLIS_T_FIELDCAT_ALV.Fieldcatalogcontainingdescriptionsofthelistoutputfields(usuallyasubsetoftheinternaloutputtablefields).

AfieldcatalogisrequiredforeveryALVlistoutputtoadddesiredfunctionality(i.e.Key,Hotspot,Specificheadings,Justify,Col.positionetc)tocertainfieldsoftheoutput.Ifnotmentionedspecifically,thenthedefaultsaretaken.Thepossiblevaluesanddefaultsarelistedbelow.

Thefieldcatalogfortheoutputtableisbuilt-upinthecaller'scoding.Thebuild-upcanbecompletelyorpartiallyautomatedbycallingtheREUSE_ALV_FIELDCATALOG_MERGEmodule.

Theminimalfieldcatalogisdocumentedbelow.Thiscanbedoneinaroutineusingalocalvariable.Theusercanusetheotheroptionalparameterstoassignoutputattributestodifferentfieldsintheoutput,whichdifferfromthedefault.

Afieldcatalogneednotbebuilt-upandpassedexplicitlyonlyunderthefollowingconditions:

1.TheinternaltabletobeoutputhasthesamestructureasaDataDictionarystructurewhichisreferredtointheinternaltabledeclarationusingLIKEorINCLUDESTRUCTURE.Inthiscasetheattributesofthedifferentfieldsistakendirectlyfromthetableandtheattributes(keyfields,length,textsetc)needtostateexplicitly.

2.allfieldsinthisstructurearetobeoutput

3.ThestructurenameispassedtoALVintheparameterI_STRUCTURE_NAMEofthefunctionmoduleREUSE_ALV_LIST_DISPLAY.

AllthevaluesenteredinthecatalogisspecifictotheparticularfieldwhosenameisenteredinthefieldnameFIELDNAMEofthefieldcatstructure.Thenameofthetableisalsoenteredinthecorr.FieldnameTABNAMEofthestructure.

Thedifferentpossibleattributesare:

∙Row_pos(rowposition):

Onlyrelevantifthelistoutputistobemulti-line(twoorthreelines)bydefault.So,thisattributecanbeusedmaintaincertainlevelofalignmentintheoutput.

Valueset:

0,1–3

∙Col_pos(columnposition):

Thisparameterisrelevantwhenthefieldsintheoutputaretobedifferentfromthesequenceofthefieldsintheinternaltableusedfordisplay.Theparameterspecifiestherelativecolumnpositionofthefieldinthelistoutput.Thecolumnordercanbechangedinteractivelybytheuser.Ifthisparameterisinitialforallfieldcatalogentries,columnsappearintheinternaltablefieldsequence.

Valueset:

0,1–60

∙Fieldname(fieldname):

Thisisthenameoftheinternaltablefieldforwhichtheparametersarepassedinthecatalog.

Valueset:

internaloutputtablefieldname(requiredparameter)

∙Tabname(internaloutputtable):

NameoftheinternaloutputtablethatcontainsthefieldFIELDCAT-FIELDNAMEabove.

Valueset:

SPACE,internaloutputtablename.

∙Ref_fieldname(referencefieldname):

NameoftheDataDictionaryfieldreferredto.ThisparameterisonlyusedwhentheinternaloutputtablefielddescribedbythecurrentfieldcatalogentryhasareferencetotheDataDictionary(notaprogramfield),andthefieldnameintheinternaloutputtableisdifferentfromthenameofthefieldintheDataDictionary.Ifthefieldnamesareidentical,namingtheDataDictionarystructureortableintheFIELDCAT-REF_TABNAMEparameterissufficient.

Valueset:

SPACE,DataDictionaryfieldname.

∙Ref_tabname(referencetable/structurefieldname):

StructureortablenameofthereferredDataDictionaryfield.ThisparameterisonlyusedwhentheinternaloutputtablefielddescribedbythecurrentfieldcatalogentryhasaDataDictionaryreference(notaprogramfield).

Valueset:

SPACE,nameofaDataDictionarystructureortable

Linktocurrencyunit

∙Cfieldname(currencyunitfieldname):

Thisisusedforcurrencyfieldsthathaveareferencetoanyunitfield.Thisisonlyrelevantforamountcolumnswithassociatedunit.ThisparametercontainstheNameoftheinternaloutputtablefieldcontainingthecurrencyunitassociatedwiththeamountfieldFIELDCAT-FIELDNAME.ThefieldinFIELDCAT-CFIELDNAMEmusthaveitsownfieldcatalogentry.

Valueset:

SPACE,outputtablefieldname

∙Ctabname(internalcurrencyunitfieldoutputtable):

NameoftheinternaloutputtablecontainingtheFIELDCAT-CFIELDNAMEfield.

Valueset:

SPACE,outputtablefieldname.

Linktomeasurementunit

∙Qfieldname(measurementunitfieldname):

Onlyrelevantforquantitycolumnswithunitlink.NameoftheinternaloutputtablefieldcontainingthemeasurementunitassociatedwiththequantityfieldFIELDCAT-FIELDNAME.ThefieldinFIELDCAT-QFIELDNAMEmusthaveitsownfieldcatalogentry.

Valueset:

SPACE,outputtablefieldname.

∙Qtabname(internalmeasurementunitfieldoutputtable):

NameoftheinternaloutputtablecontainingtheFIELDCAT-QFIELDNAMEfield.

Valueset:

SPACE,outputtablefieldname.

∙Outputlen(columnwidth):

Thisparameterisusedifthedesiredoutputlengthforafieldisdesiredtobedifferentfromtheinternaloutputtablefield.ForfieldswithaDataDictionarylinkthisparametercanbeleftinitial.ForfieldswithoutaDataDictionarylink(programfield)theparametermustbegiventhevalueofthedesiredfieldlistoutputlength(columnwidth).

Initial=columnwidthistheoutputlengthofthereferredDataDictionaryfield(domain).

N=columnwidthisncharacters.

Valueset:

0(initial),n.

∙Key(keycolumn):

Bydefault,thesystemmakessomefieldsintheoutputaskeyfields,providedthefieldsarekeyfieldsintheirreferencingtable.Usingthisparameter,fieldsotherthankeyfieldsofthereferencingtablecanbemadekeyfield.Thisparameterismostimportantiftheoutputneedstocontainsomefieldwhicharenotscrollableorcannotbehidden.

Iftheinternaloutputtablecontainsfieldsthatarekeyfieldsfromdifferenttables,thenallthosefieldsinthereportoutputbecomesunscrollableandcannotbehidden.So,thefieldsintheoutputinternaltableshouldnotbereferencedfromtablesinwhichtheyarekeyfields.Instead,theyshouldbereferencedtothetablesinwhichtheyarenotkeyfields,incasetheyarenotdesiredaskeyfieldintheoutput.

'X'=keyfield(keyfieldoutputincolor)andKeyfieldscannotbeinteractivelyhidden.ParameterFIELDCAT-NO_OUTmustbeleftinitial.

Valueset:

SPACE,'X'.

∙Key_sel(hideablekeycolumn):

ThisparameterisonlyrelevantforthefieldswhicharemadekeyfieldsusingFIELDCAT-KEY='X'.UsingthisparametertheKeyfieldcanbehiddeninteractively.

Thekeycolumnsequencecannotbechangedinteractivelybytheuser.TheoutputiscontrolledbytheFIELDCAT-NO_OUTparameteranalogouslytonon-keyfields.

Valueset:

SPACE,'X'.

∙No_out(fieldinfieldlist):

Thisparameterisusedtoremovecertainfieldsfromtheoutputduringinitialdisplay.Theusercanhoweverinteractivelychoosethefieldforoutputfromthefieldlistinthedisplayvariant.

'X'=fieldisnotdisplayedinthecurrentlist.

Valueset:

SPACE,'X'.

∙Tech(technicalfield):

Thisparameterisusedtomakecertainfielddisplayonlyinthefieldcatalog.Thefieldswiththisparametersetcannotbeoutputinthelistnorcantheybedisplayedinteractivelyfromthecatalog.

'X'=technicalfield.

Valueset:

SPACE,'X'.

∙Emphasize(highlightcolumnsincolor):

Asnamesuggests,thisfieldparameterisusedtohighlightcertai

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 党团工作 > 入党转正申请

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1