Monday, June 30, 2008

SAP PLant for a Material

SAP PLant for a Material

To obtain a list of PLANTS for a given MATERIAL you can use the following function module.

SAP Function Module for obtaining list of PLANTS for a given Material

K_VALID_PLANTS_OF_MATERIAL
_____________________________________________________

Here you will get a drop down list of all the PLANTS associated with a MATERIAL

Find the code Below.


REPORT ZEX_VALIDPLANTFORMAT .

Parameter: p_matnr like MARA-MATNR.

Data: int_werks TYPE TABLE OF T001W.

CALL FUNCTION 'K_VALID_PLANTS_OF_MATERIAL'
  EXPORTING
    I_MATNR               = p_matnr
    I_DISPLAY             = ' '
* IMPORTING
*    E_PLANT               =
 TABLES
   I_T001W               = int_werks
 EXCEPTIONS
   NO_VALID_PLANTS       = 1
   OTHERS                = 2
          .
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

See Also:
SAP Locating Plants for a Given Material
SAP get Plant Description For a given Material
SAP PLANT MATERIAL and STORAGE LOCATION
Plant for a Company Code


SAP Company Code for a Plant

SAP Company Code for a Plant

For determining the company code for a plant the following function module can be used.

SAP Function Module for determining company code for a Plant.

HRCA_PLANT_GET_COMPANYCODE
___________________________________________________


Please note that

A PLANT can be assigned to only one COMPANY CODE.
A COMPANY CODE can have several PLANTS assigned to it.

You need to pass the PLANT to the above mentioned Function Module.

Find the code below.

REPORT ZEX_PLANTCOMPANYCODE .


Parameter: p_werk like HRCA_PLANT-PLANT.

Data: d_bukrs like HRCA_COMPANY-COMP_CODE.


CALL FUNCTION 'HRCA_PLANT_GET_COMPANYCODE'
  EXPORTING
    PLANT                       = p_werk
 IMPORTING
   COMPANYCODE                  = d_bukrs
 EXCEPTIONS
   NO_COMPANY_CODE_FOUND        = 1
   PLANT_NOT_FOUND              = 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.
ENDIF.

See Also:
SAP Locating Plants for a Given Material
SAP get Plant Description For a given Material
SAP PLANT MATERIAL and STORAGE LOCATION


SAP Plant Material and Storage Location

SAP Plant Material and Storage Location

For retrieving Storage Location related data for a Material, you can use the following SAP ABAP function module.

SAP Storage Location related data for a Material.

MARD_GENERIC_READ_MATNR_PLANT
___________________________________________________________


The following are the IMPORT parameters:

KZRFB            Indicator: Lock
MATNR           Material
WERKS            Plant
MAXTZ            Maximum number of table lines
____________________________________________________________


The following values are retrieved.

Values from Table
MARD     Storage Location Data for Material
_____________________________________________________________



Code is given below.

REPORT ZEX_STORAGELOC .


Parameter: p_matnr like MARD-MATNR,
           p_werks like MARD-WERKS.


data: int_MARD TYPE TABLE OF MARD.


CALL FUNCTION 'MARD_GENERIC_READ_MATNR_PLANT'
  EXPORTING
*   KZRFB            = ' '
    MATNR            = p_matnr
    WERKS            = p_werks
*   MAXTZ            = 0
  TABLES
    MARD_TAB         = int_MARD
 EXCEPTIONS
   WRONG_CALL       = 1
   NOT_FOUND        = 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.
ENDIF.

See Also:
SAP Locating Plants for a Given Material
SAP get Plant Description For a given Material

Friday, June 27, 2008

SAP POP UP TABLE CONTENTS ON THE SCREEN

SAP POP UP TABLE CONTENTS ON THE SCREEN

To POP up table contents on the Screen the following function module can be used.

SAP ABAP function module to POP UP Table contents on the screen.

POPUP_WITH_TABLE_DISPLAY
___________________________________________

While developing a report if you wish to display some internal table contents on the screen it can easily be done with the above mentioned function module. While doing so you can define a hot spot or create a button the screen and pop up the internal table contents.

Find the code below.

The input parameters are as follows

ENDPOS_COL            Make sure that you define a value that will accommodate the complete column length.
ENDPOS_ROW           Put a values to ensure that the rows in the internal table should fit in
STARTPOS_COL        Co-ordinates (X-Axis) of the starting position (Column)of the POP UP Table
STARTPOS_ROW       Co-ordinates (Y-Axis) of the starting position (Row)of the POP UP Table
TITLETEXT                Title to be given

__________________________________________________________________________________________


REPORT ZEX_POPUPTABLE .

Data: d_endpos_col(4) value 25,
      d_ENDPOS_ROW(4) value 5,
      d_startpos_row(4) value 10,
      d_startposcol(4) value 10,
      d_title(100),
      d_choice like SY-TABIX.

Data: begin of int_valtab occurs 0,
      data(100),
      end of int_valtab.

move: 'This is row 1' to int_valtab-data.
append int_valtab.
clear int_valtab.

move: 'This is row 2' to int_valtab-data.
append int_valtab.
clear int_valtab.

move: 'Display Table' to d_title.


 CALL FUNCTION 'POPUP_WITH_TABLE_DISPLAY'
   EXPORTING
     ENDPOS_COL         = d_endpos_col
     ENDPOS_ROW         = d_ENDPOS_ROW
     STARTPOS_COL       = d_startposcol
     STARTPOS_ROW       = d_startpos_row
     TITLETEXT          = d_title
 IMPORTING
    CHOISE             = d_choice
   TABLES
     VALUETAB           = int_valtab
  EXCEPTIONS
    BREAK_OFF          = 1
    OTHERS             = 2
           .
 IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.





Thursday, June 26, 2008

SAP Get Plant Description for a Material

SAP Get Plant Description for a Material

A similar Function Module to the previous post to get the list of all the Plants with their description for a given Material is given below.

SAP ABAP Function Module to extract Plant and Description for a given Material is given below.

CKBA_PLANT_GET_LIST
_______________________________________

Find the code below.

REPORT ZEX_GETPLANT .

Parameter: p_matnr like CKMLMV001-MATNR.

Types:
  BEGIN OF CKBA1_WERKS_STR,
    WERKS LIKE CKMLMV001-WERKS,
    NAME1 LIKE T001W-NAME1,
  END OF CKBA1_WERKS_STR.

Data: CKBA1_WERKS_TBL TYPE CKBA1_WERKS_STR OCCURS 0.



CALL FUNCTION 'CKBA_PLANT_GET_LIST'
  EXPORTING
    I_MATNR           = p_matnr
 IMPORTING
   E_WERKS_TBL       = CKBA1_WERKS_TBL
 EXCEPTIONS
   NO_VALUES         = 1
   OTHERS            = 2
          .
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.



SAP Plants for a given Material

SAP Plants for a given Material

For extracting SAP PLANTS for a given MATERIAL the following function module can be used.

SAP ABAP FUNCTION MODULE for extracting all PLANTS in which the MATERIAL is maintained.

MATERIAL_READ_PLANTS
________________________________________


The import parameters for the above mentioned function module are as follows.

Material Number

All the PLANTS in which the above MATERIAL is maintained are extracted by the above mentioned function Module.

The fileds extracted are as follows.

MANDT       CLIENT
MATNR       Material Number
WERKS        Plant
PSTAT         Maintenance status
______________________________________________________

Find the code below.

REPORT ZEX_PLANTDETAILS .

parameter: p_matnr like mara-matnr.

data: int_plants TYPE TABLE OF MARC_WERK.

CALL FUNCTION 'MATERIAL_READ_PLANTS'
     EXPORTING
          MATNR  = p_matnr
     TABLES
          PLANTS = int_plants.

If sy-subrc = 0.

endif.


Wednesday, June 25, 2008

SAP ABAP Finding and Running Programs

SAP ABAP Finding and Running Programs

Finding and Running programs in SAP is a fairly simple process. Every one know the transaction code SE38 The ABAP Editor. If you have forgotten the program name but you know that it starts with ZSales then you can type the ZSALES* in the transaction SE38 Program Input field and press F4 or the drop down button. You will then be presented with all the programs that have 'ZSALES' as the first 6 characters in their name.

You can also use the Transaction SA38 ABAP EXECUTE PROGRAMS to run programs. Mainly this transaction is used by the Users who do not want to edit/modify or create a new program.

Transaction SA38 does have options to execute the program with variant and in the back ground mode.
_______________________________________________________________

In case you wish to find a program either because you have forgotten the name or you are just looking for a report existing in the system, then you can use any of the Transactions mentioned above. Transaction SE38 has more flexibility.

Let us examine Transaction SE38 for the different options available for finding a program.

Transaction SE38 THE ABAP EDITOR

To find a Program in SAP ABAP goto Utilities >>>>> Find Program (CTRL+SHIFT+F4)

Once you are there you can either enter the Program name or Short Description or development class. All the programs with the same description and development class would be displayed depending on what you had entered.

Finding ABAP Program names based on the following criterion.

Program Author
Last Changed By
Changed On
Program Type
Status
Application
Logical Database
Authorization Group
Only Editor Lock Active
Fixed Point Arithmetic Only

This can be easily achieved by clicking the 'ALL SELECTIONS ' Button (SHIFT+F7)
_______________________________________________________________

Transaction SA38 ABAP EXECUTE PROGRAM

To have more options click on Utilities >>>>>>> Find Program (CTRL+SHIFT+F2)

Here you can search the program based on the following options.

Program
Authorization Group
Application
Status



Tuesday, June 24, 2008

SAP Function Module String Numerical

SAP Function Module String Numerical

For converting a string to a numerical value the follwing Function Module can be used.

SAP ABAP function module to convert string to a numerical value.

IF_CA_MAKE_STRING_NUMERICAL

Find the code below.

REPORT ZEX_STRINGTONUMBER .

Parameter: p_string(20).


data: d_value like CAWAO_S_FIELDS-NUM_VAL.


CALL FUNCTION 'IF_CA_MAKE_STRING_NUMERICAL'
  EXPORTING
    INPUT_STRING        = p_string
 IMPORTING
   VALUE               = d_value
 EXCEPTIONS
   NOT_NUMERICAL       = 1
   OTHERS              = 2
          .
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.


Write:/ d_value.


SAP Function Module String Scramble

SAP Function Module String Scramble

In ABAP if you wish to scramble a STRING it can be easy done with the help of the following function module.

SAP FUNCTION MODULE TO SCRAMBLE STRING

DP_SCRAMBLE_STRING

The inputted string is scrambled with some numeric characters.

Note: The LOWER CASE option does not work in this Function Module and you may have to do a work around to make it work.

Find the code below.

REPORT ZEX_STRINGSCR.

Parameter: p_pass(100) LOWER CASE.

data: d_passowrd(100).

d_passowrd = p_pass.

CALL FUNCTION 'DP_SCRAMBLE_STRING'
  CHANGING
    PASSWORD       = d_passowrd
          .

 Write:/ d_passowrd.

Related Links:
Creating Valid Password in SAP
Function Module to Create Passwords in SAP

Monday, June 23, 2008

SAP ABAP Negative Sign Before a Number

SAP ABAP Function Module to place negative Sign Before a Number

In SAP the negative sign by default come after the number. In case if you wish to place the negative sign before the number the following function module should be used.

SAP ABAP Function Module to place the sign before a number.

CLOI_PUT_SIGN_IN_FRONT

The above mentioned function module has the following parameters.

VALUE

Note: This is a changing parameter and accepts the value with Data Type Character.

Find the code below.

REPORT ZEX_SIGN .

Parameter: p_num1 type i,
           p_num2 type i.

Data: d_sum type i,
      d_value(10).

d_sum = p_num1 + p_num2.
d_value = d_sum.

Write: d_sum.

CALL FUNCTION 'CLOI_PUT_SIGN_IN_FRONT'
  CHANGING
    VALUE         = d_value
          .
SKIP.
write:/ d_value RIGHT-JUSTIFIED.



SAP Function Module Import Clipboard

SAP Function Module Import Clipboard

If you wish to import the contents of the clipboard into SAP, then you can use the function module given below.

SAP ABAP function module to import the windows clipboard contents

CLPB_IMPORT

The above mentioned Function Module grabs the contents of the windows clipboard into an internal table. Once the contents are in the internal table they can be processed as desired.

Find the code below.

REPORT ZEX_CLIPBOARDIMP .

types: ty_tab(200) type c.
Data: wa_tab type ty_tab,
      int_tab type table of ty_tab.



CALL FUNCTION 'CLPB_IMPORT'
     TABLES
          DATA_TAB   = int_tab
     EXCEPTIONS
          CLPB_ERROR = 1
          OTHERS     = 2.

IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.



SAP ABAP Copy to ClipBoard Function Module

SAP ABAP Copy to ClipBoard Function Module

If you wish to copy the contents of the internal table to the Windows clipboard, you can do so by using the following function module.


SAP ABAP Function Module Copy to Clipboard
CLPB_EXPORT

If you use this function module, then the contents of the internal table can be copied to the Clipboard of the Presentation Server. Once the contents are copied to the clipboard they can be pasted into any windows application.


Find the code below.

REPORT ZEX_CLIPBOARDEXP .

types: ty_tab(200) type c.
Data: wa_tab type ty_tab,
      int_tab type table of ty_tab.

Move: 'This is line 1 again' to wa_tab.
append wa_tab to int_tab.
clear wa_tab.

Move: 'This is line 2 again' to wa_tab.
append wa_tab to int_tab.
clear wa_tab.

CALL FUNCTION 'CLPB_EXPORT'
     TABLES
          DATA_TAB   = int_tab
     EXCEPTIONS
          CLPB_ERROR = 1
          OTHERS     = 2.
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.


Sunday, June 22, 2008

SAP Tool Based Reports

SAP Tool Based Reports

One of the Tool used to generate reports in SAP is given below.

  • Report Painter and Report Writer
SAP Report Writer and Report Painter:

This tool can be accessed as follows.

SAP Menu >>>> Information Systems >>>> Ad Hoc Reports >>>> Report Painter


Under Report Painter you have the following Options

Report (GRR1 Create, GRR2 Change, GRR3, Display, GR34 Delete)
Model  (GRR4 Create, GRR5 Change, GRR6 Display)
Utilities
  Catalog
  Transport
Report Writer
  Set
  Variable
  Key Figures
  Standard Layout
  Library
  Report
  Report Group
  
Note: Instead of using ABAP code to write a report in FI and CO, Transaction MC27 is used by a lot of consultants to build a report by using Report Painter/ Report Writer library.  Transaction  GRCT has many advantages over MC27 in most cases, and eliminates the need to use transaction MC27.

Friday, June 20, 2008

SAP Goods Movement

SAP Goods Movement

In SAP goods are moved in different locations. There are transactions that are responsible for carrying out the Goods Movement.  For carrying out goods movement the following need to be understood. Goods Receipt, Goods Issue, Stock Transfer, Transfer Posting.

SAP Goods Receipt:

When goods are received from a vendor or from production and a posting is carried out in SAP, then it is known as a  Goods Receipt (GR). Once a Goods Receipt is performed the Ware House Stock is increased.

Goods Issue:

Goods going out are termed as goods Issue. Basically it can be of the following type.

  • Material Issue
  • Material Withdrawal
  • Material Consumption
  • Shipment of Goods
Once the posting is carried out in SAP , Goods Issue results in Reduction of Stock.

Stock Transfer:

The movement of goods internally from one place to another is termed as stock transfer. This can be between Storage Location to Storage Location, Warehouse to Warehouse or between Bins, between same plants or between different plant.

Transfer Posting:

Some examples of Transfer Postings are as follows.

Material to Material, Release from Quality Inspection Stock, Transfer of consignment in companies own stock. A transfer posting may or may not carry out a physical movement of goods.



SAP Production Planning and Controlling Standard Reports

No Report Selection Screen Transaction Description Area
1 Order Progress Report

Plnt                          
Sales order                   
Sales order item              
Project                       
WBS element                   
Material                      
Production/process order, netwo
Plnd order 
Overall prof

CO46 This is a very good report which gives the status of the orders in progress.  
2 Production Order Information System

Production order           
Material                   
Production plant           
Planning plant             
Order type                 
MRP controller             
Production scheduler       
Sold-to party              
Sales order                
Sales order item           
WBS element                
Sequence number            
Priority                   
Selection profile status   
Sys. status 
Work center         
Plant               
Selection profile   
Sys. status
Component            
Plant                
Storage location     
Selection profile    
Sys. status    
Basic start date          
Basic finish date         
Scheduled start date      
Scheduled finish date     
Scheduled release date    
Actual start date         
Actual finish date        
Actual release date       

COOIS This report gives complete information on Production Orders. Production Planning
3 Production Order Cost Analysis Order
Cumulated    
Limited      
KKBC_ORD This report basically gives a report on Target Cost against the Actual Cost Production Planning
4 Planning Report Cost Center KSBL

This report can be used to view cost center plan

Controlling
5 Profitability Report Operating Concern
Report
Variant
KE30

This report can give you profitability at the sales order level. However it is necessary to implement PA module

Controlling

Thursday, June 19, 2008

SAP MRP List Function Module

SAP MRP List Function Module

To get a MRP list similar to SAP Transaction MD05 you can use the following Function Module.

SAP ABAP Function Module to get MRP list

MD_MRP_LIST_API

The above mentioned Function Module gives MRP List output. For more details on the outputted list please check the following

OutPut Parameters

Structure
MDPS                              Item in MRP document
MDEZ                              Individual lines of the MRP elements
MDSU                             Total lines for MRP elements

Input Parameters

PLSCN                           Planning scenario in long-term planning
MATNR                         Material Number
WERKS                          Plant
BERID                           MRP area
AFIBZ                            Name of display filter
LIFNR                            Vendor Number

Related Tables

MDKP                             Header Data for MRP Document
MDTB                             MRP table
MDTC                             Aggregated MRP table items
T457T                             Description of MRP elements

Related Transaction Code MD05
_____________________________________________________

Please find the code below.

REPORT ZEX_MRPLIST .


Parameter: p_matnr like MARC-MATNR,
           p_werks like MARC-WERKS.


Data: st_MT61D like MT61D,
      st_MDKP  like MDKP,
      int_MDPS TYPE TABLE OF MDPS,
      int_MDEZ TYPE TABLE OF MDEZ,
      int_MDSU TYPE TABLE OF MDSU.


CALL FUNCTION 'MD_MRP_LIST_API'
  EXPORTING
*   PLSCN                          =
    MATNR                          = p_matnr
    WERKS                          = p_werks
*   BERID                          =
*   AFIBZ                          =
*   SINFG                          = 'X'
*   LIFNR                          =
*   AFHOR                          =
*   DTNUM                          =
*   INPER                          =
*   DISPLAY_LIST_MDPSX             =
*   DISPLAY_LIST_MDEZX             =
*   DISPLAY_LIST_MDSUX             =
 IMPORTING
   E_MT61D                        = st_MT61D
   E_MDKP                         = st_MDKP
 TABLES
   MDPSX                          = int_MDPS
   MDEZX                          = int_MDEZ
   MDSUX                          = int_MDSU
 EXCEPTIONS
  MRP_LIST_NOT_FOUND             = 1
   MATERIAL_PLANT_NOT_FOUND       = 2
   ERROR                          = 3
   OTHERS                         = 4
          .
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

SAP Stocks/Requirements List Function Module

SAP Stocks/Requirements List Function Module

To get a list of Stocks/Requirements in SAP, you can use the Function Module given below.

SAP ABAP Function Module to get Stocks/Requirements List.

MD_STOCK_REQUIREMENTS_LIST_API
______________________________________________________


The above mentioned SAP Function Module extracts data that is similar to transaction MD04 (Stocks/Requirement List).

Note: This function module is an RFC (Remote-Enabled Module) this makes it accessible from non-sap systems as well

Related Logical Database MSM

For Logical Database See Also:

Logical DataBase Programs
Logical Database Structure
__________________________________________________________________________________________________________

The Function Module
MD_STOCK_REQUIREMENTS_LIST_API takes the following inputs

PLSCN        Planning scenario in long-term planning
MATNR       Material
WERKS        Plant
BERID         MRP Area
ERGBZ        Selection rule
AFIBZ         Name of display filter
INPER         Internal period indicator
DISPLAY_LIST_MDPSX
DISPLAY_LIST_MDEZX
DISPLAY_LIST_MDSUX
____________________________________________________________________________________________________________

The following Parameters are exported.

Material number, Plant, Deletion Flag, Material description, Material type, Material group, Base unit of measure, Plant-Specific Material Status, MRP type, Procurement Type, Special procurement type, Mixed MRP indicator, Low-level code, Dependent requirements ind. for individual and coll. reqmts, Indicator for Requirements Grouping, MRP controller, Purchasing group, Indicator: MRP controller is buyer (deactivated), In-house production time, Processing time, Setup and teardown time, Interoperation time, Base quantity, Scheduling Margin Key for Floats, Planned delivery time in days, Goods receipt processing time in days, Total replenishment lead time (in workdays), Indicator: automatic fixing of planned orders, Lot size (materials planning), Fixed lot size, Minimum lot size, Maximum lot size, Rounding value for purchase order quantity, Maximum stock level, Assembly scrap in percent, Safety stock, Reorder point, Ordering costs, Storage costs indicator, Forecast indicator, Period indicator, Splitting Indicator, Discontinuation indicator, Effective-Out Date,, Follow-up material, Method for Selecting Alternative Bills of Material, Valuation class, Price control indicator, Moving average price/periodic unit price, Standard price, Price unit, Stock in transfer (plant to plant)

For more Details of the fields see the following

Structure
MT61D
MDPS
MDEZ
MDSU
Transparent Table
MDKP
______________________________________________________________________

See the functional code below.

REPORT ZEX_STOCKREPORT .

Parameter: p_matnr like MARC-MATNR,
           p_werks like MARC-WERKS.


DATA: int_mdpsx  TYPE TABLE OF mdps,
      int_mdezx  TYPE TABLE OF mdez,
      int_mdsux  TYPE TABLE OF mdsu,
      int_mdinx  TYPE TABLE OF mdin.

DATA: wa_mt61d TYPE mt61d,
      wa_mdezx TYPE mdez.

* Initial screen
CALL FUNCTION 'MD_STOCK_REQUIREMENTS_LIST_API'
  EXPORTING
    matnr   = p_matnr
    werks   = p_werks
  IMPORTING
    e_mt61d = wa_mt61d
  TABLES
    mdpsx   = int_mdpsx
    mdezx   = int_mdezx
    mdsux   = int_mdsux
  EXCEPTIONS
    OTHERS  = 1.


    if sy-subrc = 0.

    endif.


See Also:
SAP Availability Check BAPI/Function Module

Wednesday, June 18, 2008

SAP Availability Check BAPI/Function Module

SAP Availability Check BAPI/Function Module

If you need to check the availability of a Material using a program, then you can make use of the following BAPI.

SAP Availability check BAPI
BAPI_MATERIAL_AVAILABILITY
__________________________________

This BAPI returns the Available quantity.

The code given below shows how to call this BAPI. The import parameters of this BAPI are

Material
Plant
Unit
________________________


REPORT ZEX_AVAILIBILITYCHK .

Parameter: p_matnr like BAPIMATVP-MATNR,
           p_werks like BAPIMATVP-WERKS,
           p_unit  like BAPIADMM-UNIT.

*Data: int_wmdvsx like BAPIWMDVS occurs 0 with header line,
*      int_wmdvex like BAPIWMDVE occurs 0 with header line.

Data: int_wmdvsx  type table of bapiwmdvs with header line,
      int_wmdvex  type table of bapiwmdve with header line,
      d_WKBST like BAPICM61V-WKBST.



           CALL FUNCTION 'BAPI_MATERIAL_AVAILABILITY'
             EXPORTING
               PLANT                    = p_werks
               MATERIAL                 = p_matnr
               UNIT                     = p_unit
*              CHECK_RULE               =
*              STGE_LOC                 =
*              BATCH                    =
*              CUSTOMER                 =
*              DOC_NUMBER               =
*              ITM_NUMBER               =
*              WBS_ELEM                 =
*              STOCK_IND                =
*              DEC_FOR_ROUNDING         =
*              DEC_FOR_ROUNDING_X       =
*              READ_ATP_LOCK            =
*              READ_ATP_LOCK_X          =
            IMPORTING
*              ENDLEADTME               =
               AV_QTY_PLT               = d_WKBST
*              DIALOGFLAG               =
*              RETURN                   =
             TABLES
               WMDVSX                   = int_wmdvsx
               WMDVEX                   = int_wmdvex
                     .


Write:/ d_WKBST.

 If sy-subrc = 0.

 endif.


Creating a Valid Password in SAP

Creating a Valid Password in SAP

Find below some useful tips for creating a new Password in SAP.

  • Length of the SAP Password has to be in the range of 3 to 8 Characters
  • If you are changing the password, then the new password should not be a replica of any of the last 5 passwords
  • Password should not be the reserved words pass or init
  • SAP Password cannot be a blank space
  • The first 3 characters of a Password cannot be the same for example nnnewp
  • As mentioned in the first point a password cannot be less then 3 characters eg. fl
  • Password cannot contain an exclamation mark !file
  • SAP Password cannot contain a question mark eg. ?mypass
  • The password can be any combination of alphanumeric characters including a to z, 0 to 9 and punctuation marks
When ever you are logging on to the SAP system for the first time, you need to enter a new password. It is always a good practice to change the password every month. Many companies have a Password Policy and you need to follow these policies strictly.
__________________________________________________________________

See Also: Function Module to Generate SAP Password


Tuesday, June 17, 2008

SAP R/3 Bookmarking Websites

SAP R/3 Bookmarking Websites

In the WEB 2.0 world each and every one of us is connected to the Web from work and/or from home. SAP R/3 has a way of Bookmarking your favorite websites. All the SAP related websites/URLs can be added to the favorite menu in SAP, this makes it easier and convenient for the user to visit the websites of their choice.

To add your favorite URL/Website to the SAP Menu please follow the steps given below.

In the SAP main Screen Right Click on the Favorite's Menu.

The following option will be available.

Open Folder
Delete all Favorite
Insert Folder
Insert Transaction
Add Other Objects

To add a Web Address/URL/Website click on Insert Folder. You will be presented with a Dialog Box with the following fields.

  • Folder Name
Enter the Desired Folder Name. If you wish to enter the name of your Favorite SAP Website ABAPLOVERS.BLOGSPOT.COM then create a FOlder with the name ABAPLOVERS.

Once this folder is created right click on ABAPLOVERS. The following options will be available.

Open Folder
Change Favorite
Delete Favorite
Insert Folder
Insert Transaction
Add Other Objects

Select Add Other Objects, then the following options will be available.

Web Address or File
Drag-and-Relate Component
Knowledge Warehouse
SAPScript (text defined with SE16)

Select Web Address or File. In the resulting Dialog Box enter the following.

Text                                                  ABAPLOVERS Tutorials on ABAP
Web Address or File                         http://www.abaplovers.blogspot.com

Click on ok

Similarly you can Add any other transaction or a website of your choice in the Favorite's menu.