Posts

BAPI for material storage location Add

 We can add material storage location plant wise using third party app or web. BAPI names : BAPI_MATERIAL_MAINTAINDATA_RT Import parameters: HEADDATA: Material Tables: STORAGELOCATIONDATA: Material: Plant: STGE_LOC:   STORAGELOCATIONDATAX: Material: Plant: STGE_LOC:   use below code after completing steps. CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.        

READ_TEXT Function Module in SAP ABAP

  Use of FM 'READ_TEXT' to read the various text objects not only in sale order, any document in SAP.  The function module reads the desired text from the text file, the text memory, or the archive. You must fully specify the text using OBJECT, NAME, ID, and LANGUAGE. An internal work area can hold only one text; therefore, generic specifications are not allowed with these options. CALL FUNCTION 'READ_TEXT' EXPORTING ID = '0001' LANGUAGE = 'E' NAME = TDNAME OBJECT = 'VBBK' HEADER = HTEXT TABLES LINES = LTEXT EXCEPTIONS ID = 1 LANGUAGE = 2 NAME = 3 NOT_FOUND = 4 OBJECT = 5 REFERENCE_CHECK = 6 .    

Function Module to get user details in SAP ABAP

 Based on user we need to find out user details in sap. we can use below FM to get our desire result. FM:  'SUSR_USER_ADDRESS_READ'      DATA: user_address LIKE  addr3_val.     CALL FUNCTION 'SUSR_USER_ADDRESS_READ'       EXPORTING       IMPORTING         user_address                 = user_address       EXCEPTIONS         user_address_not_found       = 1         OTHERS                       = 2.        write:/ user_address-name_text.     ENDIF.

Inline Declaration in ABAP (Keyword: DATA)

 The new declaration operator DATA allows inline declarations of variables with declaration expressions in declaration positions. Declaration positions are write positions where the operand type can be determined from the context statically. lets look at below examples on how to use this in real world programming. Example:  while use loop:       Loop at itab into DATA(wa_itab).       ...........  Endloop.     Call transformation .... result XML  DATA(xml).   The work area can now be dynamically defined and used via inline declaration. While importing data in methods, the target variables can now be dynamically defined and used by inline declaration. using in select query also:      SELECT  a ~ prueflos ,  a ~ plnty ,  a ~ plnnr ,  a ~ plnal ,  b ~ vorglfnr ,  b ~ merknr ,  b ~ verwmerkm ,  b ~ formelsl      FROM ...

Spell amount in SAP ABAP

Use of  FM  ' SPELL_AMOUNT '   DATA :  WS_SPELL TYPE SPELL,  pLANGU LIKE T002-SPRAS DEFAULT SY-LANGU,  pCURR LIKE TCURC-WAERS DEFAULT 'USD',  pAMOUNT LIKE VBAP-MWSBP ,  pFILLER(1) TYPE C DEFAULT ' '.   CALL FUNCTION 'SPELL_AMOUNT'  EXPORTING   AMOUNT = pAMOUNT   CURRENCY = pCURR   FILLER = pFILLER   LANGUAGE = pLANGU "SY-LANGU  IMPORTING   IN_WORDS = WS_SPELL  EXCEPTIONS   NOT_FOUND = 1   TOO_LARGE = 2   OTHERS = 3 . IF sy-subrc <> 0.  MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO   WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. ELSE.  WRITE :/ WS_SPELL-word , WS_SPELL-decword. ENDIF.

Text color in a Smartforms

Image
 Based on user requirement we need to color text. Here i show you how to color text in a smartforms. We can fulfill our requirement by adding a new paragraph format or character format in smartforms style.In below show how to  add color.Hope it will help you adding text color in your smartforms. You can just assign this format in your smartforms text.

FM for fetch value against unconverted value in SAP ABAP

 In SAP ABAP sometimes we need to show value field data but when we fetch data from table we get unconverted value. Most of the time its happens when we need to show Base unit of measurement. In below I show you the process with example.Hope it will help you to find the desire field. Function module name: " CONVERSION_EXIT_CUNIT_OUTPUT "   CALL  FUNCTION  'CONVERSION_EXIT_CUNIT_OUTPUT'              EXPORTING                INPUT     =  GS_QAMV - MASSEINHSW                LANGUAGE  =  SY - LANGU              IMPORTING *             LONG_TEXT           ...

Function Module for sign (+/-) position change in SAP ABAP

 In SAP sign's are coming after number. But in our real life practice we need to show them before number.We can solve the problem by using a FM. The name of FM is   "CLOI_PUT_SIGN_IN_FRONT" Here I show you how to use it with a example. Suppose you get your value and keep it in a variable. Now need to follow as like below. UPP_val = GS_QAS- TOLERANZOB.            CALL  FUNCTION  'CLOI_PUT_SIGN_IN_FRONT'              CHANGING                VALUE  =  UPP_VAL .   By using it you are getting your desire result. 

Sum of a field in SAP ALV Report

 In sap ALV report some times we need to sum column value. We can easily doing this job just define <field catalog>-do_sum = 'X' and must define <field catalog>-fieldname = 'QUAN' / 'CUR'. example given below:       W_FIELDCAT - FIELDNAME  =  'Deviation' .   W_FIELDCAT - DO_SUM  =  'X' .   W_FIELDCAT - DATATYPE  =  'QUAN' .   W_FIELDCAT - SELTEXT_L  =  'Deviation %' .   W_FIELDCAT - TABNAME  =  'TY_TABLE' .    APPEND  W_FIELDCAT  TO  FIELDCAT .

Bill of material in SAP

 we can define BOM as "List of all materials required in a process together with the quantities required. BOM is part of master data of production planning and also used in discrete manufacturing. In general, the BOM is created and edited directly from within the master recipe for which it is required. By creating a production version, you can uniquely combine a master recipe with an alternative BOM. The material components of the alternative BOM can then be assigned to the operations or phases of the master recipe and be taken into account in material quantity calculation.

SAP Fiori Button Types

 Buttons allow us to trigger an action. There are 4 types of buttons.  Simple Button Toggle Button Segmented Button Menu Button Uses of Buttons: Simple Button: for specific action like: Create ,Edit,Save,Approve, Reject,Accept,Decline,Ok , Cancel. Toggle Button: in a toolbar to activate or deactivate an object or element. Segmented Button: used for year , month , Day, Small, medium , large. Menu Button: used for more than one button.

Movement Types in SAP

 What Is a Movement Type? When you enter a goods movement in the system, you must enter a movement type to differentiate between the various goods movements. A movement type is a three-digit identification key for a goods movement. The following table contains examples of movement types. Description of Movement Types Below you will find a short description of the standard movement types. The reversal movement type is the movement type + 1 (reversal of 101 = 102).  101 Goods receipt for purchase order or order  If the purchase order or order has not been assigned to an account, a stock type (unrestricted-use stock, stock in quality inspection, blocked stock) can be entered during goods receipt. If the purchase order or order has been assigned to an account, the goods receipt is not posted to the warehouse, but to consumption. In the case of non-valuated materials, the goods receipt is posted to the warehouse, although the purchase order has not been assigned to an acc...

Types of views in UI5

 Views in SAPUI5 is like a user interface. Views display data using the model to the user and also enables them to modify the data. In SAPUI5, the views basically is a container for UI5 screen elements (such as button, input fields, tables, lists, etc) and UI5 layouts (HBox, VBox, Flex box, etc). The views are used to define and render the UI. In SAP UI5 there are 4 types of views.They are: JS Views XML views HTML views JSON Views