domingo, 29 de agosto de 2021

CDS view - Search help com descrição do texto

 Exemplo, descrição do material

Importante  lembrar de colocar a categoria de dados e a semantica de texto


@AbapCatalog.sqlViewName: 'ZDDV_CDS_SZK_T8'

@AbapCatalog.compiler.compareFilter: true

@AbapCatalog.preserveKey: true

@ObjectModel.dataCategory: #TEXT

@AccessControl.authorizationCheck: #CHECK

@EndUserText.label: 'Material'

@OData.publish: true


define view ZDD_CDS_SZK_T8 as select from makt

 {

 key matnr as CodMat,

      @Semantics.text: true

      @EndUserText.label: 'Descrição'

      cast(maktx as abap.char(30)) as Mattxt


} where spras = $session.system_language


--- Na view principal

define view ZDD_CDS_SZK_T3

  as select from vbak as A

  association [1..*] to zdd_cds_szk_t6 as _ItemOV   on $projection.DocVen = _ItemOV.Vbeln

  association [1]    to ZDD_CDS_SZK_T4 as _SalesOrg on $projection.OrgVen = _SalesOrg.SalesOrganization

  association [1] to ZDD_CDS_SZK_T7 as _ItemOVSum   on $projection.DocVen = _ItemOVSum.Vbeln

  association [1] to ZDD_CDS_SZK_T8 as _MatF4  on $projection.CodMat = _MatF4.CodMat

{


      @UI.facet: [

      {

      id: 'Info',

      type: #DATAPOINT_REFERENCE,

      purpose: #HEADER,

      position: 10,

      qualifier: 'OrgVenda'

       },

       -- facet de corpo

       {

      id: 'Dados',

      label: 'Info geral',

      type: #COLLECTION,

      purpose: #STANDARD,

      position: 10

       },

       {

      label: 'Dados NF',

      type: #IDENTIFICATION_REFERENCE,

      purpose: #STANDARD,

      position: 10,

      parentId: 'Dados'

       },

       {

       id: 'Item',

       type: #LINEITEM_REFERENCE,

       purpose: #STANDARD,

       targetElement: '_ItemOV',

       position: 20

       }


       ]

     

      @ObjectModel.text.association: '_MatF4'

     

      @UI.lineItem: [{ position: 10 }]

  key A.vbeln                            as DocVen,

      @UI.lineItem: [{ position: 30 }]

      @UI.selectionField: [{position: 30}]

      @ObjectModel.foreignKey.association: '_SalesOrg'

      @Consumption.filter: { selectionType: #RANGE, multipleSelections: true }

      @UI.dataPoint: { qualifier: 'OrgVenda', title: 'Organização de vendas' }

      A.vkorg                            as OrgVen,

      @UI.lineItem: [{ position: 40 }]

      @UI.selectionField: [{position: 40}]

      @UI.dataPoint: { title: 'Canal de distribuição' }

      A.vtweg                            as CanDist,

      @UI.lineItem: [{ position: 50 }]

      @UI.selectionField: [{position: 50}]

      @UI.identification: [{ position: 10 }]

      A.spart                            as SetAtiv,

      @UI.dataPoint: { title: 'Cliente' }

      A.kunnr                            as CodCli,

      @UI.hidden: true

      A.auart                            as TpOV,

      (concat('Doc.Venda :', A.vbeln ) ) as TxtDoc,

      case  

      when _ItemOVSum.SomaTotal < 10 then 1

      else 3 

      end as StatusCor,

      @UI.lineItem: [{ position: 60 },

                     { criticality: 'StatusCor', value: 'TotalQtd' }]

      _ItemOVSum.SomaTotal as TotalQtd,      

       

      _ItemOVSum.totitem as TotItem,             

      

     @UI.selectionField: [{position: 50}]  

      @ObjectModel.foreignKey.association: '_MatF4'

      @Search.defaultSearchElement: true

      --@Consumption.filter: { selectionType: #RANGE, multipleSelections: true }

      _ItemOV.Matnr as CodMat,

             

      _ItemOV,

      _ItemOVSum,

      _SalesOrg,

      _MatF4

      

}



quinta-feira, 19 de agosto de 2021

Teclas de atalho eclipse para abap

https://blogs.sap.com/2013/11/21/useful-keyboard-shortcuts-for-abap-in-eclipse/

 Editing source code:

ShortcutWhat it will do
CTRL+DDeletes the selected codeline
CTRL+SHIFT+DELETEDeletes the content from the cursor postion to the end of the line
CTRL+DELETEDeletes the next word in the editor
CTRL+BACKSPACEDeletes the previous word in the editor
ALT+UP/DOWNMoves the selected codelines up/down in the editor
CTRL+ALT+UP/DOWNDuplicates Codelines before/after the selected codeline
CTRL+UP/DOWNScrolls Line up/down
SHIFT+ENTERAdds a new line below the current line and positions the cursor in that line
CTRL+SHIFT+ENTERAdds a new line above the current line and positions the cursor in that line
CTRL+ZUndo changes
ALT+SHIFT+RRename the selected object, e.g. variable, method, class
CTRL+1Opens Quickfix/Quickassist Dialog on the selected element
CTRL+7Comments/Uncomments selected code in the editor
SHIFT+F1Formats the source code (aka. Pretty Printer)
CTRL+SHIFT+F1Formats the marked source code or source code block (e.g. method)
CTRL+NCreates new development object
CTRL+SHIFT+XConvert marked editor content to upper case
CTRL+SHIFT+YConvert marked editor content to lower case
CTRL+UUnlock Editor

Navigation:

CTRL-LJump to line in editor
CTRL-OLaunch the quick outline
ALT+LEFT/RIGHTNavigate through the editor navigation history
CTRL+ ; / :Step quickly through the editormarkers, like tasks, bookmarks, error markers, ATC findings etc.
F3Navigate to the definition of the selected element, e.g. variable, method, attribute etc.

Editor Tabs:

CTRL + EDisplays a list of all open editors
CTRL + F6Easily switch between the editor tabs (Like Tab for Windows)
CTRL + F7Easily switch between all eclipse views
CTRL + F8Easily switch between the perspectives
CTRL + MMaximize the active editor or viewer to full-screen mode
CTRL+3Easily open Eclipse views or trigger command via the Quick Access Inputfield
CTRL+PAGE UP/PAGE DOWNNavigate through the editor tabs forward and backward
ALT+PAGE UP/PAGE DOWNNavigate through the tabs of the class editor between global class, local class and test classes
CTRL + F4Close the active editor tab
CTRL+SHIFT+F4Close all editor tabs

Debugging:

CTRL+SHIFT+BSet a line break point in the ABAP editor