Wednesday, February 2, 2011

Adding Fields to CJI3 Report

Target Readers: SAP ABAP developers with basic knowledge of Customer Exits and Basic ABAP syntaxes.


Purpose of the document: To add Vendor No and Vendor Name in report CJI3.

In CJI3 Vendor name will come for only invoices, when offsetting account type(GKONT) is K, but for GRN documents system will not show the vendor no, so to get this we need to add two fields Vendor No(LIFNR) and Name(NAME1) in CJI3 report where report should give Vendor details for GRN documents also.

Enhancement Process:

1. Add fields to structure “RKPOS” using field exitCI_RKPOS” using Customer exit “COOMEP01”.

2. Add fields to the view “V_TKALV”, so that these fields should get added to the field catalog of CJI3 report.

3. Add required code in the exit “EXIT_SAPLKAEP_001

Step 1.

Goto CMOD and Create a Project.

Goto Enhancement Assignment and add “COOMEP01” and double click on include “CI_RKPOS”. Add customer required fields as shown below:



Step 2:

Now we need to add the above fields in the field catalog of CJI3 .


For that we need to maintain View V_TKALV. Goto SM34, enter V_TKALV and Press Maintain button

Double click on “Field catalog information

And press push button New Entries”.

Add the required fields as shown below.

Then select these entries and click on “Selection dependencies” as shown below :

Press on New Entries and create the following entries:

Now save the entries.

Step 3.

Add required code in “EXIT_SAPLKAEP_001”.

*&---------------------------------------------------------------------*
*& Include ZXKAEPU01
*&---------------------------------------------------------------------*
IF I_REP_OBJECT = 'PD'.

IF CS_RECORD-GKONT IS NOT INITIAL AND CS_RECORD-GKOAR = 'K'.

CS_RECORD-ZZLIFNR = CS_RECORD-GKONT.
CS_RECORD-ZZNAME1 = CS_RECORD-GKONT_KTXT.

ELSEIF CS_RECORD-EBELN IS NOT INITIAL.

SELECT SINGLE LIFNR FROM EKKO INTO CS_RECORD-ZZLIFNR
WHERE EBELN = CS_RECORD-EBELN.

IF SY-SUBRC = 0.

SELECT SINGLE NAME1 INTO CS_RECORD-ZZNAME1 FROM LFA1
WHERE LIFNR = CS_RECORD-ZZLIFNR.

ENDIF.

ENDIF.

ENDIF.

I_REP_OBJECT specifies which report you are using, so as to avoid unnecessary selection we need to keep the required value only. For CJI3 report the value for I_REP_OBJECT is ‘PD’.

And activate the enhancement as shown below.

Now we will check CJI3 Report.

Execute. Now go to change catalog you will find the added columns as shown below.

Now the O/P will be as shown below:




No comments:

Tutorials on SAP-ABAP

Adobe Interactive Forms Tutorials

Business Server Pages (BSP)

Userexits/BADIs

Web Dynpro for ABAP (Step by step procedure for web dynpro,Tutorials on Web Dynpro,)

ALV Tutorials

Blog Archive

goodsites