Posts

Showing posts from July, 2019

Using BAPI upload excel file for t-code AS02 in SAP

Using BAPI " BAPI_FIXEDASSET_CHANGE " create a zprogram to upload excel file for mass change fixed asset in SAP. REPORT  ZAS02_ASSET_CHANGE_UPLOAD . TYPE-POOLS :  truxs . " Structure for Excel data TYPES :  BEGIN  OF  ty_excel ,          anln1  TYPE  anln1 ,          bukrs  TYPE  bukrs ,          kostl  TYPE  kostl ,          werks  TYPE  werks ,          prctr  TYPE  prctr ,         END  OF  ty_excel . DATA :  lt_excel     TYPE  TABLE  OF  ty_excel ,       ls_excel     TYPE  ty_excel ,     ...

Serial Number in SAP ALV report

In sap there are multiple types of report , ALV is one of them.Today I am sharing my real life experience with you.I faced lots of problem to solve it but at last I did it with out having any problem. One of my report functional people gave me a requirement where serial Number column is allocated. But in ALV serial no is not referenced,better to ignore coz when you need to sort it then the serial number sequence is not maintain, that's the bad impact of it. At the very first time I declared a variable and then control it in my final internal table and modify my internal table.  Like: Data: Slno type i. Slno = 0. Loop at itab into wa.  Slno = Slno + 1. wa-Slno = Slno. modify itab from wa. Endloop. Another way is very simple ,just take a variable and assign sy-tabix, your work is done. Data: Slno type i. Loop at itab into wa. Slno = sy-tabix wa-Slno = Slno. Endloop. If it helps you then give me a feedback, your feedback boost me a lot.

Sort Internal Table

Sometimes we need to sort our internal table based on functional requirement. We can sort it like : Ascending , Descending , text or Alphabetically. Syntax like : Sort itab Ascending. or sort itab by field_name  Ascending Sort itab Descending  or sort itab by field_name  Descending Sort itab by field_name.

Minus Sign Position change in SAP ABAP.

In sap by default minus sign display in the right side of the field. In case if users demands to change its position then need to use FM to fulfill the requirement. In  below example is given: Functional Module : CLOI_PUT_SIGN_IN_FRONT Report: Sign_Position_change. Parameter : Number1 type I,                    Number2 type I. Data : Sum type I,           Change_Sign(15) type I. Sum = Number1 + Number2. Change_Sign = Sum. CALL FUNCTION 'CLOI_PUT_SIGN_IN_FRONT' CHANGING Value = Change_sign. Write: / 'After Shifting: ',Change_sign.