Posts

Showing posts from September, 2022

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.