0% found this document useful (0 votes)
130 views131 pages

Class X Imp Notes Cbse

Transport Request and types normally when we development anything in development server....we download that into a file and then upload into qualtiy server. But in SAP instead of this downloadinga nd uploading they introduced a new concetp called TR.Number. A Tr number is sued to move your developments/config from one sys to another sys. TR000001 is called the actual TR/Parent TR and TR000002 is called the Task/Child TR and this is created per user.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
130 views131 pages

Class X Imp Notes Cbse

Transport Request and types normally when we development anything in development server....we download that into a file and then upload into qualtiy server. But in SAP instead of this downloadinga nd uploading they introduced a new concetp called TR.Number. A Tr number is sued to move your developments/config from one sys to another sys. TR000001 is called the actual TR/Parent TR and TR000002 is called the Task/Child TR and this is created per user.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd
You are on page 1/ 131

Quest

Answe

ACTIV
INACT
Prima

STEP1
STEP2
STEP3

SM30

step2

Step3
Transport Request and types

normally when we development anything in development server....we


download that into a file and then upload into qualtiy server

But in SAP instead of this downloadinga nd uploading they introduced


a new concetp called TR.Number.

A Tr number is sued to move your developments/config from one sys to another sys

the tcode is SE01,SE02,SE03....SE10/...ETC

EXample
------
TR000001-------->This is called actual TR/Parent TR
TR000002------->This is called as Task/Child TR and this is created per uname.

sometimes the TR looks as below when we multiple users are using same TR
TR000001--------->This is called actual TR/Parent TR
TR0000002-->This is called as Task/Child TR and this is created per uname1:ARJUN
TR0000003-->This is called as Task/Child TR and this is created per uname2:RAVI
TR0000004-->This is called as Task/Child TR and this is created per uname3:RAMU

TR Types
---------
we have 4 types of TR'S

1.Customizing TR--->All FUnc configs are captured under this TR.(SCC1 Tcode)
2.Workbench TR--->All ABAP developments-RICEFW are captured under this TR.
3.Transport Copies--->A special type of TR which is created as a copy of original TR.
4.Relocations

what is Workbench TR
------------------------
Anything which is client independant is saved under a TR called Workbench TR-
Ex : ABAP Program is client independant and it is saved under Workbench TR

client independant means...suppose if i login to client no:100....and develop a program


then it will be visible in other client numbers 200, 300 , 400 as well automatically..
This is called client independant.

what is Customizing TR
Now when a func cons configures comp codes, plants....etc and saves it...now the sys
checks weather the config is client dependant or cleint indep.......

As youknow all the config are client dependant.....so system generated a TR called
Customizing TR.

That is why all the TR created by func cons are Customizing TR.

and then sometimes the fun cons wants to move the config from client 100 to 200
or 200 to 300 or 300 to 400....Then they use SCC1 Tcode whch is also called as
CLient COpy.

And then when you want to move the config from SERVER TO SERVER then we use
TR movements....i.e. Relase the TR and BASIS team moves the TR to another server.

TR concept

FIRST PARENT TR
CHILD TR
YOUR CONFIGS
400AR01===>400CLINT NO,,,,,AR01 is the COCOde

E070
E071
are the tables for TR'S.

SE09 is the Tcode for TR'S


SCC1 is the Tcode to move from client to client
SE09 is the tcode to move From Server to Server

Whan a Table starts with T….those are called as config table


EX: T001, TOO1W, TOO5…ETC

Whan a Table ends with T….those are called as TEXT/DESC table's


EX: T001T, TOO1WT, TOO5T…ETC

Whan a Table starts with V….those are called as VIEWS…..But not tables

Transport of Copies

Creating a copy of the exisitng Cust/WB TR is called as TOC

Jan 01-->You have done some Config in DEV Server and saved under TR000001
Now we want to move thsese config to QUALITY server
Normally we release the TR and import in the QULAITY SERVER
Instead of releasing the TR0000001 …..Just create TOC for the TR000001
Lets say TOC TR0000005 is created and lets release thhis TOC TR and import in the QUALITY server

TR0000001-----Jan01,2019------------->Never Release this TR…but create TOC of this TR


TOC0000005
TOC0000007
TOC0000009
TOC00000011
TOC00000015
Finally on Jan 30, lets say we got the approval that the cofig is tested and ready to move to PROD server

Now we can move only one TR i.e. TR000001 to Quality and Prod SERVER
What is the Advantage here is….We always have singe TR for our Config's

Normal Procedure of TR'S

Create a TR -TR000001---------->Relase TR---->Import TR000001 in QUALITY SYSTEM


Then again you want to do some changes in the Config
Now system will create a NEW TR TR000005 Bcoz the exisitng is already Reeased and imported in the QUALITY Serevr
Then again you want to do some changes in the Config
Now system will create a NEW TR TR000007 Bcoz the exisitng is already Reeased and imported in the QUALITY Serevr
Then again you want to do some changes in the Config
Now system will create a NEW TR TR000009 Bcoz the exisitng is already Reeased and imported in the QUALITY Serevr
Then again you want to do some changes in the Config
Now system will create a NEW TR TR0000011 Bcoz the exisitng is already Reeased and imported in the QUALITY Serevr
Then again you want to do some changes in the Config

On Jan 30………………..Finally we got the approval that the cofig is tested and ready to move to PROD server
Now we have to move all the below TR'S to Production

TR0000001
TR0000007
TR000009
TR0000005
TR00000011
Instead of this procedure….suppose if we have created a TOC TR …………then we can move only one TR
TR000001---->move his TR to Quality////// and Production

CHARM/SOLMAN
Some client use CHARM/SOLMAN as a tool for TR management
ARJUN is the Lead and will create a TR0000001 in the CHARM and is given to developers or consulatnats

lets say comsultant1 uses the TR TR000001 and now system creates a task(child TR) TR000002

lets say comsultant2 uses the TR TR000001 and now system creates a task(child TR) TR000003

lets say comsultant3 uses the TR TR000001 and now system creates a task(child TR) TR000004

ABAP/Data Dictionary (SE11/SE16N)

ABAP Dicitonary is the central location where technical objects like TABLES,VIEWS…ETC can be created/changed/deleted
SE11 is the tcdde
SE16N is the tcode to display the data of tables,views.

Name of the tables/views….etc must strat with Y/Z


When you click on save….system will asks for Package/Folder……Give the name

Create a table to store the below data

Fieldname
customer no
name1
country
currency

Now how to find the legth of the field


FI DOC NR - 10 digits
local currency -

What is DATA ELEMENT - DATA Element is a option to provide the detailed information about a field
That is
1.What is the Description
2.What is the Length
3.What is the DATATYPE
But SAP has provided lot of predefined data Elements and Field names
So….we no need to create new data eements or fields
Just use the exisiting given by SAP
How to find the exsiting data elements or fields……..CICK F1-->click Tech Info-->Double lcick on the field name and note down t

Client Independan Table

KUNNR

SAVE THE DATA-->SYSTEM DOES NOT KNOW IN WHICH CLIENT THE DATA SHOULD BE SAVED
SO THE SYSTEM SAVES THE DATA IN ALL THE CLIENT NUMBERS…800 ,810,820,830…ETC
THIS IS CALLED CLIENT INDEPENDENT TABLLE
here there is no security to your data

Client dependan Table--->A table which has MANDT as first field is called Cl.Dep.Table
MANDT

Enter the data in the table and save--->system saves the d ata only in one client i.e. Login Client.

EX: Login to 810 and save the data


MANDT

Here the data is saved in only one client


but here we have security to the data

Can we move the table data from DEV-->QUA-->PROD


YES …..via some special settings called recording routine in Table Maintenance option

MEANS THE TABLE/PROG/FM…ETC CAN BE USED EVERYWHERE IN SAP


MEANS THE TABLE/PROG/FM…ETC CANNOT BE USED EVERYWHERE IN SAP
Means what is the Unique field in the table
or
Means what are the fields which specify a unique record in table
Creation of a Table
CREATE A TABLE
CRATE TABLE MAINTENANCE OPTIONS and specify weather the table data should be transported or not
CREATE A TCODE FOR THE TABE

IS a tacode to maintain the data in the tables by Func team/end users in a simple way
Steps to create a table--->Watch the video and create the table

Create TABLE MAINTENANCE OPTIONS--->Please watch the video to create Table Maintenace Option

Authorization Group : &NC& means without any authorziation group-->means everuser can maintain data
suppose if only few u sers wants to maintain the data then basis team will create a AUTHGroup
That AUTHGroup name must be enetered here

Function Group : Group of Funcions internally to mintainn the data


This is like a ABAP Program running behind SM30

Maintenance Type--->Here you select One step or Two step


One step-->means one screen
Two Step-->Means Two screens with detailed information

How to you control weather the table data should be transported or Not transported?????

Lets say we do not want to tranport the data then….please select the option : NO RECORDING

Lets say we want to tranport the data then….please select the option : STANDARD RECORDING

DATA Validation
so whenever we enter the data in the tabke…..we want to validate the data-->Then follow the below setps and create Validati

select the field in the table-->click on FK Icon--->system will propose the Config /master table-->click on YES
The validation is active---->Watch the video

Creating a ZTCODE for Table maintenance instead of using SM30--->Watch the video

SE93 is the tcode to create ZTCODE

Tcode:Z101-->Internally it will call SM30 only and configute the default table name here : ZCUSTOMERS_03
What is Domains
Domain means---->it’s a option which provides Technical Information like DATATYPE,LENGTH,FIXED VALUES,CONFIG/MASTER

DataElement--->It’s a option which provides Decsription for a field in various Languages.

Sir, Can you please show us 2nd option of SE93 (Report transaction), does it takes it to source code screen or any inp

Structures

Structures are same as tables ,,,the diff is,,,,,,tables is collection of fields and it stores data
wheras a STRUCTURE is just a collection of fields without storing data

What is the use of structures


Structres are like Templates which can be resued in many tables.
While creating a table…..I will give 1 or 2 or 3 or 4 fields manually and then I enter the STRUCTURE XXXXXX n
Once I enter the STRUCTURE name……all the fields from that strucures will be copied to the table.

Creating a STRUCTURE
Step1 --->Create a STR : ZADDRESS_FIELDS with some fields.-->Activate it
Step2--->Include the STR in the required Tables

Using / Including Structures in the Tables


There are 2 ways
1.Using .INCLUDE xxxxxxxxxxxxx where xxxxxxxxxxx stands for STR NAME
2.Using APPEND xxxxxxxxxxxxxxxxx where xxxxxxxxxxx stands for STR NAME

.INCLUDE xxxxxxxxxxxxx -------------------->This is used in the custom Tables


APPEND xxxxxxxxxxxxxxxxx-------------------------->This is used in std sap tables when we want to add new fields.

Ex: The Func Cons asks the ABAP team to add the new fields in
1.FB01 Tcode----------->ABAP team finds what is the Main tabke,,,,ex: BKPF
2.VA01 Tcode
3.ME21 Tcode

STEP1 : Add the New fields to the Backend Tables,ex,BKPF using APPEND STRUCTURE
STEP2 : Add the same fields to the frontend Transaction,ex,FB01
STEP3 : Add the ABAP Logic to map the fields from frontend transaction to the Backend Tables via USEREXIT.
Please note that ---------->This is the most tough scenario in ABAP and it requires lot of testing as well Bcoz
we are customizing std sap transaction

Indexes in Tables
Index means sorting the table data as per required fields,ex,Customer wise, material wise,COCODE wise
When we do indexing….the reports become faster Bcoz the data is sorted/indexed already
When your reports are slow….Please create a Index on the exatc table and exact field
What is that Exact Table and field……This requires some analysis from ABAP….
Then based on the analysis….a Index is created on that Table and field
Now the reports become faster

There are 2 types of Indexes


1.Primary Index-----------> A Index/sorting already ceated on Primary Key fields when Table is activated
So…we have to always use Primary Key fields when SELECTING the data from tables in Reports
SELECT * FROM KNA1
WHERE KUNNR = '1000001'
OR
SELECT * FROM KNA1
WHERE NAME1 = 'ARJUN' .------------------>To improve the performance of this QUERY
we have to sort/create index on this field i.e.NAME1

2.Secodary Index----------------->A Index/Sortinf created on non primary key fields is called Sec Index
This is created based on the demand from func cosultant.

EX: SD Reports…Please tell me on what basis we normally run the reports


i.e. what is the selection criteria.
SELECT * FROM SD_TABLES
WHERE SALES_ORG =
AND ORDER_TYPE =
AND DOC_DATE =

IN fico………Every Report will have


COMPCODE
DOCNR
FYEAR
DOC TYPE

Steps to create Sec Index

Types of tables in SAP


Inn SE11….when we create a table…By default system creates a Transparent Table.

There are 3 types of tables in SAP


1.Transparent Table - The table which is created in the ECC and DB with the same name is called…….
Used to store Master data and Transaction data
2.Cluster Table - The cluster tables are linked to One singke Table in DB is called ………
Are used to store Huge Transaction data of one Application--BSEG data
These tables must not be used in programming unless it is mandatory.
Cluster tables put more performnace on the DB and the prog becomes slow
3.Pooled Table- - The pooled tables are special types of tables which stores system data like
Tcode name-->its Prog name-->Its scree number-->its field names…..etc
also system information like Current date, time, SAP versionnumber…..etc
These pooled tables also like cluster tabkes….Which has Many-To-One Relation---->means Inside the database
It has another table by name : TABLE POOL
IN HANA………………..all these pool and cluster tables are removed
All old and new tabkes are replaced by Transparent Table

Views
A view is a collection of fields from multiple tables
You can think of views as SAP Queiries
But SAP query is a Report
and View is a just a obejct which displays the data by combinging multiple tables

SELECT * FROM ZVIEW1.


KNA1
VBAK/VBAP
MARA

JOIN TYPES
Table joins is common concept in Oracle,SQL,SAP,HANA
Joins means joining the tables in Views and SAP Queries
There are 4 types of Joins
1.Inner Join-------->common data from both the tables will be selected
2.Outer Join(Left Outer Join)--->The data from Left table is selected and displayed first. If there is same data in secnd table then
is displayed…else….Blank values are displayed
3.Right Outer Join--->The data from Right table is selected and displayed first. If there is same data in secnd table then also da
is displayed…else….Blank values are displayed
4.Full JOIN

MAT MASTER TABLE ---->MARA--10 Mateials in our comp


MAT plants table --->MARC--->8 materials extended for Plants
when we join MARA and MARC via
1.Inner Join---> 8 materails are common and displayed via Inner Join
2.Outer Join--->10 material will be displayed with 2 balnks
3.Right Outer Join--->Is not supprted in SAP now
4.Full Join--->Select the data from the tables.

GL MASTER DATA-->SKA1
GL COCODE DATA---->SKB1

Types of VIEWS
DB View-------------->A view with Inner Join is called DB View
Help View---------->A view with Left Iuter Join is ccalled Help View
Maintenance View---->A View to maintain the data is callaed….Maintenance View and it also uses Inner Join or Left Outer Join
Projection View------------>A view on single table is called Projection View
Sometimes a Table can have 400 fields.
Then we may not require all the 400 fields but we want 25 fields then we create projection View

ABAP Programming (SE38/SA38)


SE38 is the tocde for creating Programs
SA38 is the tcode for executinng the Programs

* ---- STAR means all the fields from the table


ITAB--------->Means a Temp table to store data-->Internal Table--->STORES Multiple records
LOOP---------->Means Reading/looping each record from ITAB to another temp memory called WA
WA------->Means a Temp area to store data but only single record.
SELECT ---->To select the data from DB Table into ITAB
WHERE--->Means filters in the SELECT
SYST-SUBRC ------------->It is a system field which tells weather the SELECTION is success or failed
IF SYST-SUBRC = 0…..Means Success….Else….Failure
Parameters --->Means input values for a field.

SELECT * from KNA1 into table ITAB.


LOOP AT ITAB INTO WA.

SELECT SINGLE * FROM MARA into WA.

IT_XXXX
WA_XXXX

EX: IT_MARA / IT_SKA1 / IT_KNA1 / I_KNA1 / I_MARA / I_SKA1


WA_MARA / WA_SKA1/ W_MARA / W_SKA1

*****ALL Itabs here


DATA IT_MARA LIKE TABLE OF MARA.
DATA IT_KNA1 LIKE TABLE OF KNA1.

*-----All WA's Here


DATA wa_KNA1 LIKE KNA1.
DATA wa_MARA LIKE MARA.

SELECT * FROM KNA1 INTO TABLE IT_XXXXX WHERE COUNTRY = 'IND'


IF SYST-SUBRC = 0.
LOOP AT IT_XXXX INTO WA_XXXXX.
IF WA_XXXXXX-STATE = 'TG' .
DOWNLOAD THE RECORD TO A FILE
ELSE.
WRITE : / WA_XXXXXX-KUNNR , NAME1 , NAME2,EMAIL.
ENDIF .
ENDLOOP.
ELSE.
WRITE : / 'XXXXXXXXXXXXXXXXXXX INVALID COUNTRY' .
ENDIF .
SELECT SINGLE * FROM KNA1 INTO WA_XXXXX
WRITE : / WA_XXXXX-KUNNR ,
WA_XXXXXX-NAME1,
WA_XXXXXX-NAME2,
WA_XXXXXXX-EMAIL .

PARAMETERS P_MATNR LIKE MARA-MATNR .


PARAMETERS P_MTART LIKE MARA-MTART.
SELECT SINGLE * FROM MARA
INTO WA
WHERE MATNR = P_MATNR
AND MTART = P_MTART .
IF SY-SUBRC = 0 .

ELSE.

ENDIF .

USE CONTROL < keys for comments


USE CONTROL > keys for un comments

DATA it_bkpf LIKE TABLE OF bkpf .


DATA wa_bkpf LIKE bkpf .

PARAMETERS p_bukrs LIKE bkpf-bukrs OBLIGATORY .


SELECT * FROM bkpf
INTO TABLE it_bkpf
WHERE bukrs = p_bukrs .
IF sy-subrc = 0 .
LOOP AT it_bkpf INTO wa_bkpf.
WRITE : / wa_bkpf-bukrs ,
wa_bkpf-belnr ,
wa_bkpf-gjahr ,
wa_bkpf-bktxt.
ENDLOOP.
ELSE.
WRITE : 'Invalid CoCode' .
ENDIF .

SELECT-OPTIONS=========>This is also like parameters but this takes ranges or multiple values as Inputs

Ex
SELECT-OPTIONS SO_XXXXXXX FOR TABLE-FIELDNAME OBLIGATORY .

VARIANTS
Saving the Paramters and Select-Options Values to avoid the data entry is called as a VARIANT

Dynamic variants

Variants using TVARC Table


Sometimes multiple programs will be using same varinats.
In such cases…………….we cannot change the variant manually.
In that case…..we use TVARC table and store the variant values in the table.
The maintainted values will be selected from the table into the VARIANT.

Debugging ABAP Programs


Debugging means checking each line of the Program how it is executed and observing the resukts of each stmt.
Debugging is started by setting Break-Poinnts or using /H
What is Break-Point--->Means a Point/line no to stop the program execution .
Once the program is stopped….then we can cheack each line of the Program how it is executed and observing the resukts of ea

we have 4 buttons/options/keys in debugging to move the cursor


F5--->This key is used to move the curosor line by line
F6--->This Key is used to execute the FM,Subroutine,Method…etc in a single click
F7---->This key is used to come back from SAP program or any program to Our Program
F8---->This key is used to move the cursor to the Next break-point.
Suppose if Next Break-point is not available then system exits the debugging and display the final result.

IT_BKPF[0rows * 100columns]===>it_bkpf[10*100]
Structure------------>In the programs structure can store a single record
Means Structre acts like a WA

IF WA-FIELDXXXXXX IS INTIAL ------------>Initial means EMPTY


CONTINUE.------>measn…..do not process current record but continue to next record

SY-TABIX------------->stores current ITAB record number in the WA.

MESSAGES IN SAP
SE91 is the tcide for messages.
All the messages related to a pplication like SD/M//FI/ are stored in SE91
For every message there will be a number like 000,001,002…..999
The message Number will be - Msg_class + number

Entry XXXXX does not exist in YYYY (check entry)


Entry & does not exist in & (check entry)

Function Modules
It is a Sub Program/Child Program inside a Main program
Sometimes we want to divide main pograms into smaller parts for reusablitiy.
Main prog with 1000 lines of SubProg1 - FM
code

Call FM
SubProg2 - SubRoutine
Call SUbRoutine

Call Include
SubProg3 - Include Program

Main Prog2

Call FM

Call SubRoutine

Call Include
What Actually is a FM
FM is a subprogram which has
Imports----->Inputs to the FM means a single value/record/line
Exports----->Outputs from the FM means a single value/record/lin
Tables----->ITAB's as Inpouts and Outputs means Multiple values/Records/Lines
Changing---->Changing Values inside the FM
Exceptions--->Are errors inside the FM
Source Code---->means ABAP Code

SE37 is the Tcode for FM


All FM's are put inside a folder called FunGroup/Function Pool
SAP has released 1000's of Std FM's
But we can develop custom FM's also

Some Std FM's are -


GUI_UPLOAD
GUI_DOWNLOAD
F4_FILENAME
SEND_MAIL
BAPI_GL_ACC_GETDETAIL
BAPI_SO_GET_DETAIL……………………………..etc

Please note that


For every Application …we have a Tcode like Create xxxx,Change xxxxx,Display xxx,Delete xxxxx
Similarly For every Applicaton, we have a program….Those Programs are called as FM'S like
XXXXX_CREATE/POST/INSERT OR BAPI*XXXX*CRE*/SAVE/POST
XXXXX_CHANGE/EDIT
XXXXXX_DISPLAY/GET/GETDETAIL
XXXXXX_DELETE

SO….Please goto SE37 and serach for the FM usinng


*GL*GET*
*SALE*ORDER*CREATE*
*PO*CREATE*
*GL*ACC*POST*
*EMP*GET*

Steps for Function Consultant on this Topic

SE37
Find the FM name using *xxxx*
Observe the Imp/Exp/Tables tabs
Click on Test/Execute Icon
Enter the Inpputs
Save the data as a Variant for future Refernce
Execute
The resuults will be displayed in table by name RETURN
Read the error and correct the Inputs and Try to Post again until you can get success message

Ex--As dicussed this FM:BAPI_MATERIAL_SAVEDATA is a Replica of MM01/MM02.


Like this….Please find all the relavant FM'S for your Tcodes

Module Pool programs - Means Creating new SAP Programs with screens
for ex , ZVA01,ZME21N,ZFB01
- Now in 2012 onwards….These are obselete and SAP is recomming to create SAP FIORI apps
for all the custom Programs with Screens.

Where do we actually use these FM'S in Real time when we already have SAP tcodes like MM01,VA01,FB01…etc

The answer is -
My requirement is to create a Mat Master in SAP -
Then use MM01 for a single Material
Suppose you want to create 5000 Mat Masters…..Then…ABAPer call FM 'BAPI_XXXXXX
or
Suppose you want to create single Mat Master fromm 3rd Party sys….Then ABAPer/Fu
for the FM 'BAPI_XXXXXXXXXXX' and give the name to 3rd party so that they can c

What is RFC- It is also a FM used bwteen SAP to SAP means SAP ECC to CRM/SRM/APO/EWM…etc
What is BAPI-It is also a FM used between SAP and NONSAP means SAP ECC to ORACLE,BANK,TALLY,JAVA,MOBILE…etc

How to find the FM 'BAPI_XXXX' inside the std tcode like FB01/MM01…etc??
The answer is …we are not sure weather SAP std Tcode used BAPI_XXXXX
But anyways…..the answer is ……Start Debugging using /H
Enter
use the menu path: BREAK-POINT--->BREAK-POINNT AT STATEMNT
Give the statement as 'Call Function'
Enter
use F8 to moove from one FM to another FM
continue until you find the BAPI_XXXXXXXXXXX
TOC

LENGTH DESCRIPTION
10 customer no
35 name1
3 country
13,2 Currency Quality SYSTem
1000
us01
NAME1 LAND1 usp1
AAA US
BBB IN
CCC DE

KUNNR NAME1 LAND1


1001 ARJUN US
1002 BBB IN
1003 CCC DE

KUNNR NAME1 LAND1


2001 AAA US
2002 BBB IN
2003 CCC DE
REPORT ZTEST1 .

DATA ITAB LIKE TABLE OF KNA1.


DATA WA LIKE KNA1.

SELECT * from KNA1 into table ITAB.

LOOP AT itab into wa.


IF WA-LAND1 = 'DE' .
WRITE : / WA-KUNNR ,
WA-NAME1 ,
WA-LAND1 ,
WA-PSTLZ.
ELSE.
CONTINUE.
ENDIF .
ENDLOOP.
*****ALL Itabs here
DATA it_mara LIKE TABLE OF mara.
DATA it_kna1 LIKE TABLE OF kna1.

*-----All WA's Here


DATA wa_kna1 LIKE kna1.
DATA wa_mara LIKE mara.

PARAMETERS p_matnr LIKE mara-matnr .

*---All Selects
SELECT * FROM mara
INTO TABLE it_mara
WHERE matnr = p_matnr .
IF sy-subrc = 0 .
LOOP AT it_mara INTO wa_mara.
WRITE : / wa_mara-matnr , wa_mara-meins.
ENDLOOP.
ELSE.
WRITE : / 'No material Found' .
ENDIF .
TABLES : BKPF .
DATA it_bkpf LIKE TABLE OF bkpf .
DATA wa_bkpf LIKE bkpf .

PARAMETERS p_bukrs LIKE bkpf-bukrs DEFAULT '1710' .


SELECT-OPTIONS SO_BELNR FOR BKPF-BELNR OBLIGATORY .
SELECT-OPTIONS SO_BUDAT FOR BKPF-BUDAT .

SELECT * FROM bkpf


INTO TABLE it_bkpf
WHERE bukrs = p_bukrs
AND BELNR IN SO_BELNR.

IF sy-subrc = 0 .
LOOP AT it_bkpf INTO wa_bkpf.
IF WA_BKPF-blart = 'SA' .
WRITE : / wa_bkpf-bukrs ,
wa_bkpf-belnr ,
wa_bkpf-gjahr ,
WA_BKPF-BLART,
wa_bkpf-bktxt.
ELSE.
CONTINUE .
ENDIF.
ENDLOOP.
ELSE.
WRITE : 'No data found for this CoCode' .
ENDIF .
Please create a Message class with name ZFICO_MSGS in SE91 and create a message with text

Report ZXXXXX Message-id 'ZFICO_MSGS' .


*****ALL Itabs here
DATA it_mara LIKE TABLE OF mara.
DATA it_kna1 LIKE TABLE OF kna1.

*-----All WA's Here


DATA wa_kna1 LIKE kna1.
DATA wa_mara LIKE mara.

PARAMETERS p_matnr LIKE mara-matnr .

*---All Selects
SELECT * FROM mara
INTO TABLE it_mara
WHERE matnr = p_matnr .
IF sy-subrc = 0 .
LOOP AT it_mara INTO wa_mara.
WRITE : / wa_mara-matnr , wa_mara-meins.
ENDLOOP.
ELSE.
MESSAGE E000.
ENDIF .
1 and create a message with text as 'Invalid Material'.
BUKRS BELNR
1710 123456
GJAHR
2019 ITAB[1*3]

You might also like