Saturday, April 23, 2022

STEPS IN CREATION OF STANDARD TEXT IN SAP.

STEPS IN CREATION OF STANDARD TEXT IN SAP. 


T-code SO10

Give name and press create

Give the text

Press save


STES IN INSERTING THE STANDARD TEXT IN FOR WINDOW


Go to Se71. 

Open form in change mode

Select the window where standard text is needed to be inserted

Press Text elements button

Insert( text( standard

Give text name

Press enter


System adds this code in the editor

How to upload a logo in SAP.

STEPS IN UPLOADING LOGO INTO SAP. 

Prepare a Bitmap Image

T-Code SE78

Expand graphics

Double click BMP.

Press import button

Give the path where image is present in you system

Give name to logo

Give description

Specify color image or Black and white image

Press enter


The image will be uploaded into SAP with the name you have given in 7th step.

If the image is of  .TIF format we have to run the standard program RSTXLDMC to upload the image into SAP. The image will be stored on document server. All the images will be stored in STXBITMAPS table.


Now my requirement is to insert the logo in one of the windows of the form that I have designed .


TYPES OF TABLES IN SAP ABA

TYPES OF TABLES IN SAP ABAP. 


There are three types of tables.

1. Transparent Tables

2. Clustered Tables

3. Pooled Tables.


TRANSPARENT TABLES:-  For every table created in Data dictionary (DDIC) there will be table created in database with same name, same no of fields, fields having same names and the order of the fields will be same. That means for every same replica of table or mirror image will be created in Data base. That means it is having one to one relation. By default every table created will be Transparent Table.


CLUSTERED TABLES:- Many tables created in DDIC are stored in single table in data base called table cluster. That means it is having many to one relation. All the tables present in table cluster will have primary key in common.


POOLED TABLES:- In  case also many tables created in DDIC are stored in single table in database called table pool. Hence it also  having many to one relation. Here the tables present in table pool many have primary key in common.

TYPES OF DATA IN SAP

 TYPES OF DATA IN SAP


There are three types of data in SAP.


Customized data

Master data

Transactional data.


CUSTOMIZED DATA:-  The data which never changes is called Customised data. This data is not created  but configured by functional consultant using SPRO tranction.


MASTER DATA: The data which changes very rarely is called Master data.


TRANSACTIONAL DATA:-  The data which changes very frequently is called Transactional data.

Friday, April 22, 2022

EVENTS IN MODULE POOL PROGRAM IN SAP ABAP.

EVENTS IN MODULE POOL PROGRAM IN SAP ABAP. 


Process before output (PBO)

Process after input (PAI)

Process on value-request (POV)

Process on help-request (POH)


PROCESS BEFORE OUTPUT:-  This event is triggered before the screen is displayed. This event is used to assign some default values to screen fields. With those values the field will be displayed.


PROCESS AFTER INPUT:-  This event is triggered after giving input to the screen fields. This is used to handle user action actions on the screen.


PROCESS ON VALUE-REQUEST:- This is used to give F4 help to screen fields.


PROCESS ON HELP-REQUEST:- This is used to give F1 help to screen fields.


The in the module pool program should be written between module and endmodule.


AT EXIT-COMMAND:- It is used to go to the leave the screen or process some logic even though some of the mandatory fields of a screen not filled.


SY-UCOMM:- It is a system variable used to catch the  function code that is triggered for user actions on the screen.


OK_CODE:- It is used as substitute for sy-ucomm.


DIFFERENCES BETWEEN AT NEW AND ON CHANGE IN SAP ABAP.

DIFFERENCES BETWEEN AT NEW  AND ON CHANGE OF IN SAP ABAP. 


At new should be used inside the loop, but on change of can be used outside the loop also.

At new takes only one field, but on change of can take multiple fields.

Let us assume that an internal table is having f1, f2, f3 , f4 and f5 fields and if  at new is applied on f3 field it will be triggered for every change in f1, f2 and f3 fields, but on change of will be triggered for only changes in f3.

DIFFERENCES BETWEEN AT NEW AND AT END OF IN SAP ABAP.

DIFFERENCES BETWEEN AT NEW <FIELD> AND AT END OF <FIELD>.


Both are used to find out subtotals but the difference is point of triggering.


At new is triggered at the starting of new record, but at last is triggered at the end of the record.

At new checks previous record, but at last checks next record.

Pre-requisites for using Control break statements


Pre-requisites for using Control break statements in sap. 

Pre-requisites for using Control break statements Control break statements should be used in side the loop but on change of can be used outside the loop. Before using the control break statement the internal table should be sorted by the field on which control break statement is going to be used.

 

AT FIRST:- This is triggered at the first record of the internal table. This is triggered only once. It is usually used to write the heading to columns while displaying the records of internal table.


AT LAST:- This is also triggered only once at the last record of the internal table. This is used to find out grand totals of numeric values.


AT NEW <FIELD>:- This is triggered at the starting of every new record based on a particular field. It is used to calculate sub totals.


AT END OF <FIELD>:- This is triggered at the end of every new record based on a particular field. It is also used to find out sub totals.

SUBROUTINES IN SAP ABAP

SUBROUTINES IN SAP. How we used in SAP. Details About SUBROUTINES IN SAP ABAP. 



When ever same logic is needed to be executed many times in a program, create a subroutine and call the subroutine when ever the logic is needed to be executed.

Perform statement is used to create the subroutine and to call the subroutine. 

A subroutine can be created with passing the variables and without passing the variables. The logic of the subroutine is written between form and endform. It is not required to start the subroutine name with Z OR Y.

The variables that are passed into subroutine are called global variables or actual variables. The variables that are used to receive the values in subroutine from main program are called local variables or formal variables.

There are 3 ways to pass the variables into subroutine.


CALL BY VALUE

CALL BY REFERENCE

CALL BY VALUE AND RESULT


CALL BY VALUE:- In this new memory area is allocated for the local variables between form and endform. When the values of local variables are changed , they are changed in only or reflected in only newly created memory area. The original values of corresponding global variables are not changed. 


CALL BY REFERENCE:- In this no new memory area is created for the local variables between form and endform. They make use of memory of the corresponding global variables. Hence when the values of local variables are changed between form and endform immediately the corresponding global variables values are changed.


CALL BY VALUE AND RESULT:-  In this new memory area is created for local variables. When ever the values of local variables are changed between form and endform, the changes are reflected in only newly created memory area. But when the control is moving back from subroutine to main program, the values present in local memory are copied back to the corresponding global variables memory area.


Hence we can say that in CALL BY VALUE the values of global variables are never changed when corresponding local variables values are changed, in CALL BY REFERENCE the values of global variables are changed immediately. In CALL BY VALUE AND RESULT the values of corresponding global variables are changed control moves from subroutine to main program.  

EVENTS IN CLASSICAL REPORTS IN SAP ABAP

 


EVENTS IN CLASSICAL REPORTS


INITIALIZATION

AT SELECTION-SCREEN

AT SELECTION-SCREEN ON <FIELD>

AT SELECTION-SCREEN OUTPUT

AT SELECTION-SCREEN ON VALUE-REQUEST FOR <FIELD>

START-OF-SELECTION

TOP-OF-PAGE

END-OF-PAGE

END-OF-SELECTION


Now we discuss what are the uses of these events.


INITIALIZATION:- This is the first event to be triggered. This event is triggered before the selection-screen is displayed. This event is used to give default vales to selection-screen fields.


AT SELECTION-SCREEN:-  This event is triggered after giving input in selection-screen fields. This event is used to handle the user actions on the screen. This is also used to validate all the selection-screen fields.


AT SELECTION-SCREEN ON <FIELD>:- This is used to validate a particular field present on the selection-screen.


AT SELECTION-SCREEN OUTPUT:- This is used to change the selection-screen properties dynamically.


AT SELECTION-SCREEN ON VALUE-REQUEST FOR <FIELD>:- This  is used to give F4 help to a particular field resent on the selection-screen.


START-OF-SELECTION:-  Main logic of the program is written in this event. Usually write statement is recognized from this event.


TOP-OF-PAGE:- This is used to write something on top of every page. The first write statement or output statement (SKIP) of a page triggers this event.


END-OF-PAGE: -  This event is used to write something at end of every page. Last line of the page triggers this event. We have to allocate the line for end of page.


END-OF-SELECTION:- Usually program output is written in this event. This event is used to handle abnormal termination of the program. The stop statement written in start-of-selection event takes the control to end-of-selection event. 

Thursday, January 27, 2022

When do we go for call transaction method and when do we go for session method in SAP ABAP?


Call Transaction:

The Call transaction is used if you need the generated document number to be returned to the program. It is often used if you need to do some additional processing after your document is generated. It is usually a small data set because if you have large data, you might have a time out error.

Sessions Method:

Sessions are used when you are unsure when you will run the BDC... you could schedule it during the night.This is used when you are working with large numbers of transactions.

DMR mass creation BAPI Name.

 Which BAPI do they use for DMR mass creation?

 
BAPI Name: BAPI_BUSPROCESSND_CREATEMULTI
 
 

Which modules are used in BDC.

 

Which modules are used in BDC?

1.BDC_Open_group.

2.BDC_Insert.

3.BDC_Close_group

These three modules are primarily used in successfully transferring data in sequence using BDC.

Tuesday, October 13, 2020

Billing Date validation In SAP ABAP.

Billing Date validation In SAP ABAP.

INCLUDE  RV60AFZZ 

FORM USEREXIT_ACCOUNT_PREP_KOMKCV.
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""$"$\SE:(1) Form USEREXIT_ACCOUNT_PREP_KOMKCV, Start                                                                                                          A
*$*$-Start: (1)---------------------------------------------------------------------------------$*$*
ENHANCEMENT 1  ZAK_INVOICE_VALID.    "active version

**TYPES: BEGIN OF ty_final,
**        vbeln TYPE vbeln_vl,
**        lfdat TYPE lfdat_v,
**       END OF ty_final.
**DATA: it_final TYPE STANDARD TABLE OF ty_final,
**      wa_final TYPE ty_final.
**
**      SELECT SINGLE vbeln lfdat
**        FROM likp
**        INTO wa_final
**        WHERE vbeln = vbrp-vgbel.
**
**      IF VBRK-FKDAT < wa_final-lfdat.
**        MESSAGE 'billing Date should not be less than delivery date' TYPE 'E'.
**        fcode = 'ENT1'.
**        PERFORM FOLGE_GLEICHSETZEN(SAPMV60A).
**        SET SCREEN 6105.
**        LEAVE SCREEN.
**      ENDIF.

How to make field Address required in transaction KE51 in SAP

How to make field Address required in transaction KE51 in SAP ABAP.

Normally SAP doesn’t provide us configuration and user exit to make fields in Address tab required in transaction KE51 . but after little bit of debug ABAP Code, i found the clue that you need to create enhancement point in include program LRKPMF05  in subroutine md_user_command_handle.

Example:

FORM md_user_command_handle CHANGING p_fcode.

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""$"$\SE:(1) Form MD_USER_COMMAND_HANDLE, Start                                                                                                                A

*$*$-Start: (1)---------------------------------------------------------------------------------$*$*

ENHANCEMENT 1  ZIMP_CO_REQUIRED_ADDR_KE51.    "active version

"Added By Rachmad Kurniawan

"Tgl 06/10/2016

IF md_fcode = 'MD_SAVE'.

 IF PRCT_V-STRAS EQ ''.

  MESSAGE 'You must input Street' TYPE 'E'.

ENDIF.

IF PRCT_V-ORT01 EQ ''.

 MESSAGE 'You must input Kota' TYPE 'E'.

ENDIF.

 IF PRCT_V-LAND1 EQ ''.

 MESSAGE 'You must input Country' TYPE 'E'.

ENDIF.

 IF PRCT_V-REGIO EQ ''.

 MESSAGE 'You must input Region' TYPE 'E'.

ENDIF.

 ENDIF.

ENDENHANCEMENT.

Definition of Infotype within the Data Dictionary in ABAP HR

Definition of Infotype within the Data Dictionary.

Each infotype nnnn requires at least two structures and one table:

• Structure PSnnnn

Structure PSnnnn contains all of the infotype data fields.

• Structure Pnnnn

Structure Pnnnn contains infotype key fields and all of the data fields from structure PSnnnn .

• Transparent table PAnnnn and/or transparent table PBnnnn

Transparent table PAnnnn is required if you want to use an infotype within Personnel Administration.

If you want to use an infotype within Recruitment, transparent table PBnnnn is required.

In accordance with the distribution of infotype name ranges, objects P9nnn , PS9nnn , PA9nnn and PB9nnn are assigned to the customer name range.

Naming conventions for Infotypes in SAP ABAP HR

Naming conventions for Infotypes in SAP.

 • 0000 to 0999 – HR Master data / Applicant data

• 1000 to 1999 – Organizational Management

• 2000 to 2999 – Time data

• 4000 to 4999 – Applicant data

• 9000 to 9999 – Customer defined

Saturday, October 10, 2020

What is an IDOC Structure in SAP.

IDOC Structure.

  


Each IDOC has 3 records I.             Control Record:

Ø  It contains IDOC type & Message type information, Partner information such as partner system number, Port number of the sender & receiver system.

Ø  It is also contain technical & address information of sender & recipients.

 

     II.      Data Record:

Ø  These are collection of segments. The data record of an IDOC contains segment.

Ø  Segment is collection of fields which can be distributed the data between the systems.

 

III.         Status record:

Ø  It contains the status of the processed IDOC to know where an IDOC has been successful/failed.

Ø  The standard table EDIDC contains an IDOC information such as control records, different statuses etc.

  Note:

Ø  The Sender/Source system is also called as ‘Outbound system’.

Ø  The Receiver/Target system is also called as ‘Inbound system’.

Ø  The T-code ‘WE30’ is used to maintain different types of IDOC’s such as Basic IDOC, Extended IDOC.

Ø  The T-codes WE02/WE05 are used to list out the generated IDOC’s.

Ø  The T-code ‘WE19’ is used to test/check the IDOC.

Custom Segments:

Ø  The custom segments are starts with Z*/Y* & they are maintained by technical & functional consultants

Standard Segment:

Ø  These are system provided segments

Ø  The T-code : WE31 is used to maintain the segments

 

Message Types:

Ø  These are identifiers of the application data to be distributed between the systems

Ø  The T-code WE81 is used to create & WE82 is to assign the message types to the IDOC (Data carrier)

Ø  The standard table EDIDC contains all available message type

System provided standard message types?

Message Type

Description

MATMAS

Material Master

DEBMAS

Customer Master

CREMAS

Vendor Master

 

Partner Profiles:

Ø  These are used to maintain the partner system details with which data to be distributed such as partner number, Partner type & Message type of outbound parameters. Ø The T-code WE20 is used to maintain partner profiles

Ports:

Ø  These are used to specify the way in which data to be distributed through an IDOC

Ø  The system generates one unique port number

Ø  The T-code WE21 is used to maintain ports for IDOC process

Customer Distribution Model:

Ø  It is used to define data distribution model to exchange the messages between two logical systems (SAP – SAP/SAP – non SAP)

Ø  The T-code BD64 is used to define/maintain customer distribution model

Process codes;

Ø  It is used to identify type of the data to be distributed through an IDOC interface.

Ø  The T-code WE41/WE42 is used to work with the process code 


Friday, October 9, 2020

How to check the IDOCs in SAP.

How to check the IDOCs?

Check the IDOCs in SAP.

Ans :- WE19 is the T-code to check the IDOC’s.

1.   Execute WE02/WE05

2.   Provide the Message type: CREMAS (Logical Sys), Partner no: LS810 & Click on Execute             3. After we get the status code 03, if we want to know the IDOC is reached to destination or                 not then we execute RBDMOIND standard program.

4.  The status of an IDOC (3) use in Green color (turn 10 to12) means it is delivered   

               Successfully. Yellow traffic light indicates/the status code remains same, IDOC is in                   Progress or in the Transaction RFC & Red traffic light/the status code turns 10 to 11                 indicates the Error/the IDOC is damaged.   

5.  Expand the Data Records folder & click on each segment to see the data to be distributed.    

Wednesday, October 7, 2020

What Are The Differences Between SAP Scripts & Smartforms in SAP ABAP.

What Are The Differences Between SAP Scripts & Smartforms? Differences between SAP Scripts and Smart Forms are:



 Smart Forms are client independent and SAP Scripts are client dependent.

 Multiple page formats are possible in Smart Forms which is not the case in SAP Scripts.

 It is possible to have a Smart Form without a main window where as you create a SAP Script without a main window.

 Smart Forms generates a function module when activated, which is not the case with SAP Scripts.

 SAP Scripts require a driver program to display the output whereas in Smart Forms the form routines can be written so that it is standalone.

 An integrated Form Builder helps to design Smart Forms more easily than SAP Scripts.

 A Table Painter and Smart Styles to assist in building up the Smart Forms which is not available in SAP Scripts.

 Smart Forms generates XML output which can be viewed through the web.