Wednesday, September 26, 2012

Hide Specefic ALV Field at First Run


Below is the syntax to hide ALV field during  program run. This setting need to be applied at fieldcatalog level, user can view the field by used the layout setting.



ta_fieldcatalog-no_out 'X'.

Tuesday, September 18, 2012

Delete leading zero ABAP



Coding:

*** Output format
    SHIFT wa_repdata-hkont LEFT DELETING LEADING '0'. "GL Account
    SHIFT wa_repdata-lkorr LEFT DELETING LEADING '0'. "Prov Account
    SHIFT wa_repdata-lifnr LEFT DELETING LEADING '0'. "Account No



Output:
       15201010  
       15203020
       6000002

Sunday, September 9, 2012

ALV total and sub total






  - To enable total and sub total in ALV Grid of the fieldcatalog should be in numerical format.

eg:


     valamt TYPE DECIMALS 2,"18.Value Amount
        amtpst TYPE DECIMALS 2,"19.Amt Posted
        sapostamt TYPE DECIMALS 5, "20.Amt Posted in SAP
  END OF ty_report.


  ta_fieldcatalog-fieldname 'AMTPST'.
  ta_fieldcatalog-seltext_l 'Amt Posted'.
  append ta_fieldcatalog to ta_fieldcatalog.
  clear ta_fieldcatalog.

  ta_fieldcatalog-fieldname 'SAPOSTAMT'.
  ta_fieldcatalog-seltext_l 'Amt Posted in SAP'.
  append ta_fieldcatalog to ta_fieldcatalog.
  clear ta_fieldcatalog.