Tuesday, September 3, 2013

SAP GUI History & Logon pad files

SAP History File
C:\Users\5005070XXX\AppData\Roaming\SAP\SAP GUI

SAP Logon Pad:


Tuesday, August 20, 2013

SMARTFORM : Print Totals only on the Last page

To print Totals only on the last page and print “ Please refer to last page “ on the other pages in the smart forms.

<![if !supportLists]>1.       <![endif]>Create a window and add the following condition to print that text except on the last page. Create a text field under this window. Here we are printing “ Please refer to last page “.
Condition :Check not last page

Make window type “ Final”.




<![if !supportLists]>2.       <![endif]>Create another window(with text fields/template) and add a condition to print that value only on the last page. Here we will print the actual totals. Also check option “only after main window”.
Declare window type as final for the window which is holding the text fields.
<![if !supportLists]>3.       <![endif]>
<![if !supportLists]>4.       <![endif]> 

Output:
1st Page:


Last Page:

SMARTFORM : Print Totals only on the Last page

To print Totals only on the last page and print “ Please refer to last page “ on the other pages in the smart forms.

<![if !supportLists]>1.       <![endif]>Create a window and add the following condition to print that text except on the last page. Create a text field under this window. Here we are printing “ Please refer to last page “.
Condition :Check not last page

Make window type “ Final”.




<![if !supportLists]>2.       <![endif]>Create another window(with text fields/template) and add a condition to print that value only on the last page. Here we will print the actual totals. Also check option “only after main window”.
Declare window type as final for the window which is holding the text fields.
<![if !supportLists]>3.       <![endif]>
<![if !supportLists]>4.       <![endif]> 


SAP ABAP Copy variants from one program to another program


Use Function Module RS_COPY_SELECTION_SETS  to Copy variants from one program to another program.


Tuesday, March 26, 2013

Output /Pricing Field Catalogue-Routines/User exits


Add new  fields to Output field catalogue : Userexit_komkbv3_fill in program RVCOMFZZ

Pricing Field Catlogue:
USEREXIT_PRICING_PREPARE_TKOMP:
MOVE xxxx-PSTYV TO TKOMP-ZZPSTYV.
User exits : MV45AFZZ, /RV60AFZZ.

Tuesday, March 20, 2012

Add new field to Communication structure and Fill the new field in the user exit for Sales Order, DO, Invoice Ouptut

New fields for output control

Basics of modification in output control

  • The following communication structures are relevant for output control:
    • KOMKBK1 (Output Determination Communication Area CAS Appl. K1)
    • KOMKBV1 (Output Determination Communication Area Header Appl. V1)
    • KOMKBV2 (Output Determination Communication Area Header Appl. V2)
    • KOMKBV3 (Output Determination Communication Area Header Appl. V3)
    • KOMKBV5 (Communication Structure for Output Control Groups Appl. V5)
    • KOMPBV1 (Output Determination Communication Area Item Appl. V1)
    • KOMPBV2 (Output Determination Communication Area Item Appl. V2)
    • KOMPBV3 (Output Determination Communication Area Item Appl. V3)
  • New fields for output control are entered in the following INCLUDEs:
    • Sales activities: KOMKBZ1 (in KOMKBK1)
    • Sales document header: KOMKBZ3 (in KOMKBV1)
    • Delivery header: KOMKBZ4 (in KOMKBV2)
    • Groups header: KOMKBZF (in KOMKBV5)
    • Billing document header: KOMKBZ5 (in KOMKBV3)
    • Sales document item: KOMPBZ1 (in KOMPBV1)
    • Delivery item: KOMPBZ3 (in KOMPBV2)
    • Billing document item: KOMKBZ5 (in KOMPBV3)

If you also want to use a new field for the setup of condition tables (key field) it must also be included in the structure KOMBZ (contained in KOMB).

  • The routines and user exits for assigning values to the new fields are found in the programs RVCOMFZZ, RVCOMFZ1 and RVCOMFZ4. It is also possible to copy partners here.

The following user exits exist in member RVCOMFZ1:

    • USEREXIT_KOMPBV2_FILL (item fields in delivery)
    • USEREXIT_KOMPBV2_PARTNER (item fields for partners in delivery)
    • USEREXIT_KOMPBV3_FILL (item fields in billing document)
    • USEREXIT_KOMPBV3_PARTNER (item fields for partners in billing document)

The following user exits exist in member RVCOMFZZ:

    • USEREXIT_KOMKBK1_FILL (header fields in sales activities)
    • USEREXIT_KOMKBK1_PARTNER (header fields for partners in sales activ.)
    • USEREXIT_KOMKBV1_FILL (header fields for sales documents)
    • USEREXIT_KOMKBV1_PARTNER (header fields for partners in sales documents)
    • USEREXIT_KOMKBV2_FILL (header fields in delivery)
    • USEREXIT_KOMKBV2_PARTNER (header fields for partners in delivery)
    • USEREXIT_KOMKBV3_FILL (header fields in billing document)
    • USEREXIT_KOMKBV3_PARTNER (header fields for partners in billing doc.)

The following user exit exists in member RVCOMFZ4:

    • USEREXIT_KOMKBV5_FILL (header field for groups)

In output determination, communication table KOMB contains all key fields that can be used for conditions for output determination.

When you create new fields for output determination, you can distinguishbetween two types of fields:

  • Fields that are used in condition tables
  • Fields which are only used to query conditions.

Both types of field have to be included in KOMKBV1. Fields which are only used to query conditions do not have to be included in KOMB and T681F or in the field catalog.

Note concerning name assignment

There are two possibilities for naming the field:

    • If the field is identical to the field in the communication table (e.g. VBAK), a value is assigned to it automatically by MOVE-CORRESPONDING. If SAP delivers the field in a subsequent system version, no generation errors will be caused.
    • If the field is not identical with the field in the communication table,you have to assign a value to it using the MOVE command. Begin the field name with the letters ZZ. This will avoid generation errors if the field is later delivered by SAP in a subsequent system version.

Example 1: Creating a new key field in output control

If, for example, you want to use the field ERNAM (name of sales employee) from the sales order (table VBAK) for output determination, proceed as follows:

1. Enter the field ZZERNAM in communication structure KOMKBV1 in INCLUDE KOMKBZ3 in the Data Dictionary.

By entering the field in KOMKBZ3, you automatically include it in communication table KOMKBV1.

2. Enter ZZERNAM in the communication table KOMB (in KOMBZ).

3. Assign values to the fields

Values are assigned to the fields in function module KOMKBV1_FILL. You have to enter the field and assign value to it manually in user exit USEREXIT_KOMKBV1_FILL. You will find the statements that you can use as a reference in the user exits.

Copying partner numbers is a special case and will be explained in Example 3.

4. Include ZZERNAM in the field catalog for the condition table for sales documents. The field catalogs must contain all the fields which you want to use to structure condition tables.

Example 2: Entering a condition field in the communication block

If you want to use condition field VBAK-AUDAT for output determination, proceed as described in Example 1. Remember that it is not necessary to include the new field in KOMBZ (KOMB) or to maintain table T681F or the field catalog.

Example 3: Entering a partner number in the communication block

Example 3 presupposes that there is a new partner function for buyer ZY in the sales document and that the number of this partner is to be copied.

When entering partner numbers in the communication block, proceed as described in the examples above. Partner function ZY is assigned to partner type AP in this example.

Remember to use a different routine to assign values to the new fields. If, for example, you want to copy the partner function ZY into the new field ZZEINKA, for example, the statement is:

USEREXIT_KOMKBV1_PARTNER

WHEN'ZY'.COM_KBV1-ZZEINKA = COM_VBPA-PARNR.

The VBPA field used to assign a value to the new field depends on the partner function determined in the sales order. Each partner function is assigned to a partner type (e.g. partner function LF - partner type LI), which controls the assignment. Other source fields should be used for other partner types: COM_VBPA-KUNNR, COM_VBPA-LIFNR, COM_VBPA-PERNR and COM_VBPA-PARNR.

The following assignments exist:

  • KU => COM_VBPA-KUNNR
  • LI => COM_VBPA-LIFNR
  • PE => COM_VBPA-PERNR
  • AG => COM_VBPA-PARNR

 

Wednesday, September 7, 2011

Activate Pricing Routine -RV80HGEN

You need to run the following program to activate the Pricing Routines after the transport to production.

RV80HGEN

 

You can also create  a Transport to execute the program after the Request is transported in the target system.

 

Program Run after Transport      R3TR      XPRA     RV80HGEN

 

 

( SAP SD ,Pricing Routine, RV80HGEN)

Wednesday, June 8, 2011

Line Authorization Check for Customized Tables

1.Line Oriented Authorization Check for Custom table:

Goto following menu path from SPRO Transaction: customizing entries in the IMG under SAP NetWeaver/SAP web application Server
à Application Server àSystem Administration àUsers and Administration à Line-oriented Authorizations.



Step.2. Click on Define Org.Criteria:
In here create new criteria by pushing the “New entries” button.



In this example we will like to control access based on the key field Country, in order to do so create a criteria called Z_Country_Grp,
with the name Country Grp. If we flag the table-ind flag the criteria will affect maintenance of all tables whose key fields are related to the domains specified in the attribute later.

In this example we only want to control the access to the specific table ZMYTABLE – so we will leave it blank



Step.3. Save the entry and assign it to a transport request.

Now mark the created line and switch to attributes


Create a new entry with the data shown below.

Save it and assign it to the transport request.

Notice that you can have up to 8 organizational criterion attributes.

Now we need to assign a table and a field to our attribute

In order to do so mark the attribute and switch to Table Fields



 In here create a new entry and assign, in this example, the table ZMYTABLE, and the field name country to the attribute.

Please notice that only Key fields can be used !


Save and assign to transport request

Now we are ready for activating our organizational criteria – this is the second bullet in the IMG


Just check the active flag and the check is activated.
               --x---

Incorporate the authorization object in a role

We have now implemented the authorization check; next step is to implement it in the required roles.

In this example I have created a parameter transaction – ZMYTRANSACTION - using SM30 around the table ZMYTABLE. I have create a small test role ICC_TEST, including only the transaction ZMYTRANSACTION, and a few “support” transactions.

In the authorization part – I have inserted the object S_TABU_LIN manually – (best practice is of course to assign it in SU24), but a manual insert will also do the trick J


Now when we change one the authorization fields by pushing the pencil – the profile generator will ask us for the criteria.

Here we chose the Z_COUNTRY_GRP criteria that we have created.

We’ll now get the following popup, in this case we will grant change access, so we choose 02 – Change for activity



In the list below we’ll see the Organizational Attributes that we have created – we have the option to use up to 8 attributes – in the example we had only defined one attribute – “Country Grp”  - we assign the value DK – thus only granting access to records with DK in the key field country.

To transfer the selection back to the profile generator press th transfer button  or press F5.


Now we just need to generate the profile and assign it to a test user.

Now when this test user signs on to and executes the transaction only entries for Cty DK is displayed.


If the transaction is executed by a user with SAP_ALL all records are displayed,






Wednesday, June 23, 2010

FW: Purchase Order - Free Item Flag (UMSON)

Purchase Order Item table will not store the Free Item flag in Item Table EKPO. But, instead it is calculated based on the Invoice Receipt/Item Catg fields of EKPO.

Logic:

IF ekpo-REPOS NOT  equals to ‘X’   à Inv, rec

If Pstyp not equals to 2/7

IF above 2 conditions satisfies then ,it can be marked as free Item.

 

 

Purchase Order - Free Item Flag (UMSON)

Purchase Order Item table will not store the Free Item flag in Item Table EKPO. But, instead it is calculated based on the Invoice Receipt/Item Catg fields of EKPO.
Logic:
IF ekpo-REPOS NOT  equals to ‘X’   à Inv, rec
If Pstyp not equals to 2/7
IF above 2 conditions satisfies then ,it can be marked as free Item.


Tuesday, January 5, 2010

Sales Order PO document Type (VBKD-BSARK)

If we enter the Purchase Order type (VBKD-BSARK) in the sales order header, then it will be copied to all items of the Sales order , but XVBKD will have only one entry for the header. Item Purchase order data will not be AVAILABLE  even after the order saved , unless any other field in the Purchase order data tab  is entered in the sales Order line Item.




Sales Order PO document Type (VBKD-BSARK)

 

If we enter the Purchase Order type (VBKD-BSARK) in the sales order header, then it will be copied to all items of the Sales order , but XVBKD will have only one entry for the header. Item Purchase order data will not be AVAILABLE  even after the order saved , unless any other field in the Purchase order data tab  is entered in the sales Order line Item.





Monday, December 7, 2009

Table Logging /Change history of the table entries

Table Logging : SCU3

Check the Table Logging flag in the technical settings of the table(SE11).

 



Delivery Pick Qty Function Module

Use Function Module WB2_GET_PICK_QUANTITY to get the Pick Qty from the Delivery.

Pass the Delivery no and Delivery Item No as shown in the screen.

 



How to Find a BADI/User exit for a Transaction

Run The following Program from se38.
Code:
REPORT ztestdp_badi_find
*-----------------------------------------------------------------------
* Author         : DurgaPrasad                                         *
* Creation Date  : 03 Dec 2009                                         *
* Valid Upto Version SAP r/3 4.7.
* Steps To run this Program:(User Guide);
*.1. Run This prorgam from SE38
* 2. Run your Transaction for which you wanted to find the BADI's
* 3. When your Trsnaction stopped at Break point, check
*    the value of parameter 'EXIT_NAME'.
*    It will show you the BADI for that transaction.
*----------------------------------------------------------------------
* version: ZTESTDP_BADI_FIND v1.0
* For support
*-----------------------------------------------------------------------
* <<< Start of Comment:5005070995  :04.12.2009:

* <<< End   of Comment:5005070995  :04.12.2009:

       NO STANDARD PAGE HEADING LINE-SIZE 255.
DATA:   bdcdata LIKE bdcdata    OCCURS 0 WITH HEADER LINE.
*       messages of call transaction
DATA:   messtab LIKE bdcmsgcoll OCCURS 0 WITH HEADER LINE.
*       error session opened (' ' or 'X')
DATA:   e_group_opened.
*       message texts
TABLES: t100.
START-
OF-SELECTION.


perform bdc_dynpro      using 'SAPLSEOD' '1000'.
perform bdc_field       using 'BDC_CURSOR'
                              'SEOCLASS-CLSNAME'.
perform bdc_field       using 'BDC_OKCODE'
                              '=CIDI'.
perform bdc_field       using 'SEOCLASS-CLSNAME'
                              'CL_EXITHANDLER'.
perform bdc_dynpro      using 'SAPLSEOD' '2000'.
perform bdc_field       using 'BDC_OKCODE'
                              '=OO_PICKUP'.
perform bdc_field       using 'BDC_CURSOR'
                              'DY_0253-CPDNAME(02)'.
perform bdc_dynpro      using 'SAPLSEO_CLEDITOR' '0200'.
perform bdc_field       using 'BDC_OKCODE'
                              '=ED_SET_BREAK'.
perform bdc_dynpro      using 'SAPLSEO_CLEDITOR' '0200'.
perform bdc_field       using 'BDC_OKCODE'
                              '=ED_SET_BREAK'.
perform bdc_dynpro      using 'SAPLSEO_CLEDITOR' '0200'.
perform bdc_field       using 'BDC_OKCODE'
                              '=ED_SET_BREAK'.
perform bdc_dynpro      using 'SAPLSEO_CLEDITOR' '0200'.
perform bdc_field       using 'BDC_OKCODE'
                              '/EWB_BACK'.
perform bdc_dynpro      using 'SAPLSEOD' '2000'.
perform bdc_field       using 'BDC_OKCODE'
                              '=WB_BACK'.
perform bdc_field       using 'BDC_CURSOR'
                              'DY_0253-CPDNAME(02)'.
perform bdc_dynpro      using 'SAPLSEOD' '1000'.
perform bdc_field       using 'BDC_CURSOR'
                              'SEOCLASS-CLSNAME'.
perform bdc_field       using 'BDC_OKCODE'
                              '=WB_BACK'.
perform bdc_field       using 'SEOCLASS-CLSNAME'
                              'CL_EXITHANDLER'.

  
CALL TRANSACTION 'SE24' USING bdcdata
  
mode 'E'
  MESSAGES INTO  messtab.
if sy-subrc = 0.
  
MESSAGE i016(zz) with 'Success' text-004 text-001.
* text-004 Run your Tcode Now
*text-001 Check parameter 'EXIT_NAME' at the Break Point.
"Check the value of parameter 'EXIT_NAME'.
"  It will show you the BADI for that transaction.
  else.
MESSAGE i016(zz) with 'Error.Run Again'.
    
endif.

*perform close_group.


FORM bdc_dynpro USING program dynpro.
  
CLEAR bdcdata.
  bdcdata-
program  = program.
  bdcdata-
dynpro   = dynpro.
  bdcdata-dynbegin = 
'X'.
  
APPEND bdcdata.
ENDFORM.                    "BDC_DYNPRO

*----------------------------------------------------------------------*
*        Insert field                                                  *
*----------------------------------------------------------------------*
FORM bdc_field USING fnam fval.

  
CLEAR bdcdata.
  bdcdata-fnam = fnam.
  bdcdata-fval = fval.
  
APPEND bdcdata.
ENDFORM.                    "BDC_FIELD
 
Run the transaction for which you wanted to find a BADI. When your Transaction stopped at Break point, check    the value of parameter 'EXIT_NAME'.
    It will show you the BADI for that transaction.
 
 
 

 
 
 
Thanks & Regards
Durga  Prasad
 
 
 

Friday, December 4, 2009

OBBH Substitution FI

OBBH- FI Substitution Rules Transaction code

User exit for Substitution ZGGBS000

 

When u add a routine in the OBBH you need to define that in the user exit as below:

Definition:

 

 

FORM Code:

 

  

 


 


Thursday, December 3, 2009

Item Availability check in the Sales Order (VA02)

This is the BDC Program, which Performs the Item Availability check in the Sales Order (VA02). This works as of SAP r/3  4.7 ee Version.

 

  DATA: l_mode(1VALUE 'N'.
  
REFRESH
: it_bdcdata[], it_mesg,it_mesg[].
  
PERFORM bdc_record USING'X' 'SAPMV45A'    '0102'
,
                            
' ' 'BDC_CURSOR'  'VBAK-VBELN'
,
                            
' ' 'BDC_OKCODE'  '/00'
,
                            
' ' 'VBAK-VBELN'
  vbeln,

                            
'X' 'SAPMV45A'    '4001'
,
                            
' ' 'BDC_OKCODE'  '=POPO'
,

                            
'X' 'SAPMV45A'    '0251'
,
                            
' ' 'BDC_CURSOR'  'RV45A-POSNR'
,
                            
' ' 'BDC_OKCODE'  '=POSI'
,
                            
' ' 'RV45A-POSNR'
  posnr,

                            
'X' 'SAPMV45A'    '4001'
,
                            
' ' 'BDC_OKCODE'  '=PORE'
,
                            
' ' 'RV45A-VBAP_SELKZ(01)'  'X'
,

                            
'X' 'SAPMV45A'    '4001'
,
                            
' ' 'BDC_OKCODE'  '=SICH'
.

  
CALL TRANSACTION 'VA02'

             
USING it_bdcdata
              
MODE
 l_mode
              
UPDATE 'S'

     MESSAGES 
INTO it_mesg.

  
READ TABLE it_mesg WITH KEY msgtyp = 'S'
.
  
IF sy-subrc NE 0
.
    
READ TABLE it_mesg WITH KEY msgtyp = 'E'
.
  
ENDIF
.
  
DATA:  l_msg(255
).
  
CALL FUNCTION 'FORMAT_MESSAGE'

    
EXPORTING
      
id        = it_mesg-msgid
      lang      = 
'EN'

      
no        = it_mesg-msgnr
      v1        = it_mesg-msgv1
      v2        = it_mesg-msgv2
      v3        = it_mesg-msgv3
      v4        = it_mesg-msgv4
    
IMPORTING

      msg       = l_msg
    
EXCEPTIONS
      not_found = 
1
      
OTHERS    = 2.
  
IF NOT l_msg IS INITIAL
.
    it_out-rem = l_msg.
  
ENDIF
.