SlideShare a Scribd company logo
1 of 7
REPORT ZBDC_003 NO STANDARD PAGE HEADING LINE-SIZE 255.
TYPES: BEGIN OF TAB,
PERNR TYPE ZTAB_001-PERNR,
ENAME TYPE ZTAB_001-ENAME,
CITY TYPE ZTAB_001-CITY,
END OF TAB.
DATA: IT_TAB TYPE TABLE OF TAB,
WA_TAB TYPE TAB,
D_FILE TYPE STRING,
BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE,
MESSTAB LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.
PARAMETERS: P_FILE TYPE IBIPPARMS-PATH OBLIGATORY.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.

CALL FUNCTION 'F4_FILENAME'
IMPORTING
FILE_NAME = P_FILE.
D_FILE = P_FILE.

CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME
FILETYPE

= D_FILE
= 'ASC'

HAS_FIELD_SEPARATOR
* HEADER_LENGTH

= 'X'
=0
* READ_BY_LINE

= 'X'

* DAT_MODE

=''

* CODEPAGE

=''

* IGNORE_CERR

= ABAP_TRUE

* REPLACEMENT

= '#'

* CHECK_BOM

=''

* VIRUS_SCAN_PROFILE

=

* NO_AUTH_CHECK

=''

* IMPORTING
* FILELENGTH
* HEADER

=
=

TABLES
DATA_TAB

= IT_TAB

EXCEPTIONS
FILE_OPEN_ERROR

=1

FILE_READ_ERROR

=2

NO_BATCH

=3

GUI_REFUSE_FILETRANSFER
INVALID_TYPE

=4

=5

NO_AUTHORITY

=6

UNKNOWN_ERROR

=7

BAD_DATA_FORMAT

=8

HEADER_NOT_ALLOWED

=9

SEPARATOR_NOT_ALLOWED
HEADER_TOO_LONG

= 10
= 11
UNKNOWN_DP_ERROR

= 12

ACCESS_DENIED

= 13

DP_OUT_OF_MEMORY
DISK_FULL

= 15

DP_TIMEOUT
OTHERS

= 14

= 16
= 17

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

START-OF-SELECTION.
*perform open_group.
*
LOOP AT IT_TAB INTO WA_TAB.
PERFORM BDC_DYNPRO

USING 'SAPMSVMA' '0100'.

PERFORM BDC_FIELD

USING 'BDC_CURSOR' 'VIEWNAME'.

PERFORM BDC_FIELD

USING 'BDC_OKCODE' '=UPD'.

PERFORM BDC_FIELD

USING 'VIEWNAME' 'ZTAB_001'.

PERFORM BDC_FIELD

USING 'VIMDYNFLDS-LTD_DTA_NO' 'X'.

PERFORM BDC_DYNPRO

USING 'SAPLZTAB_001' '0100'.

PERFORM BDC_FIELD

USING 'BDC_CURSOR' 'ZTAB_001-PERNR(01)'.

PERFORM BDC_FIELD

USING 'BDC_OKCODE'’=ANZG'.

PERFORM BDC_DYNPRO

USING 'SAPLZTAB_001' '0100'.
PERFORM BDC_FIELD

USING 'BDC_CURSOR' 'ZTAB_001-PERNR(01)'.

PERFORM BDC_FIELD

USING 'BDC_OKCODE' '=AEND'.

PERFORM BDC_DYNPRO

USING 'SAPLZTAB_001' '0100'.

PERFORM BDC_FIELD

USING 'BDC_CURSOR' 'ZTAB_001-PERNR(01)'.

PERFORM BDC_FIELD

USING 'BDC_OKCODE' '=NEWL'.

PERFORM BDC_DYNPRO

USING 'SAPLZTAB_001' '0100'.

PERFORM BDC_FIELD

USING 'BDC_CURSOR' 'ZTAB_001-CITY(01)'.

PERFORM BDC_FIELD

USING 'BDC_OKCODE' '/00'.

PERFORM BDC_FIELD

USING 'ZTAB_001-PERNR(01)'

WA_TAB-PERNR.
PERFORM BDC_FIELD

USING 'ZTAB_001-ENAME(01)'

WA_TAB-ENAME.
PERFORM BDC_FIELD

USING 'ZTAB_001-CITY(01)'

WA_TAB-CITY.
PERFORM BDC_DYNPRO
PERFORM BDC_FIELD

USING 'SAPLZTAB_001' '0100'.
USING 'BDC_CURSOR'

'ZTAB_001-PERNR(02)'.
PERFORM BDC_FIELD

USING 'BDC_OKCODE'

'=BACK'.
PERFORM BDC_DYNPRO
PERFORM BDC_FIELD

USING 'SAPLZTAB_001' '0100'.
USING 'BDC_CURSOR'

'ZTAB_001-PERNR(02)'.
PERFORM BDC_FIELD

USING 'BDC_OKCODE'

'=BACK'.
PERFORM BDC_DYNPRO

USING 'SAPLSPO1' '0100'.
PERFORM BDC_FIELD

USING 'BDC_OKCODE'

'=YES'.
PERFORM BDC_DYNPRO
PERFORM BDC_FIELD

USING 'SAPMSVMA' '0100'.
USING 'BDC_OKCODE'

'/EBACK'.
PERFORM BDC_FIELD

USING 'BDC_CURSOR'

'VIEWNAME'.
PERFORM BDC_TRANSACTION USING 'SM30'.
CLEAR: BDCDATA, BDCDATA[].
ENDLOOP.

*perform close_group.
*&---------------------------------------------------------------------*
*&

Form bdc_dynpro

*&---------------------------------------------------------------------*
*

text

*----------------------------------------------------------------------*
*

-->P_0154 text

*

-->P_0155 text

*----------------------------------------------------------------------*
FORM BDC_DYNPRO USING PROGRAM DYNPRO.
CLEAR BDCDATA.
BDCDATA-PROGRAM = PROGRAM.
BDCDATA-DYNPRO = DYNPRO.
BDCDATA-DYNBEGIN = 'X'.
APPEND BDCDATA.

ENDFORM.

" bdc_dynpro

*&---------------------------------------------------------------------*
*&

Form bdc_field

*&---------------------------------------------------------------------*
*

text

*----------------------------------------------------------------------*
*

-->P_0304 text

*

-->P_0305 text

*----------------------------------------------------------------------*
FORM BDC_FIELD USING FNAM FVAL.
* IF FVAL <> NODATA.
CLEAR BDCDATA.
BDCDATA-FNAM = FNAM.
BDCDATA-FVAL = FVAL.
APPEND BDCDATA.

ENDFORM.

" bdc_field

*&---------------------------------------------------------------------*
*&

Form bdc_transaction

*&---------------------------------------------------------------------*
*

text

*----------------------------------------------------------------------*
*

-->P_0309 text
*----------------------------------------------------------------------*
FORM BDC_TRANSACTION USING TCODE.
REFRESH MESSTAB.
CALL TRANSACTION TCODE USING BDCDATA
MODE 'E'"CTUMODE
UPDATE 'S' "CUPDATE
MESSAGES INTO MESSTAB.
ENDFORM.

*include bdcrecx1.

" bdc_transaction

More Related Content

Viewers also liked

z/OS Small Enhancements - Episode 2015A
z/OS Small Enhancements - Episode 2015Az/OS Small Enhancements - Episode 2015A
z/OS Small Enhancements - Episode 2015AMarna Walle
 
【再放送】バスキュール発!UXデザイン学
【再放送】バスキュール発!UXデザイン学 【再放送】バスキュール発!UXデザイン学
【再放送】バスキュール発!UXデザイン学 schoowebcampus
 
Jash mehta process modelling
Jash mehta process modellingJash mehta process modelling
Jash mehta process modellingJash Mehta
 
Eitc team 2 tech talk-final
Eitc team 2  tech talk-finalEitc team 2  tech talk-final
Eitc team 2 tech talk-finalJash Mehta
 
Actualog presentation for mrsk
Actualog presentation for mrskActualog presentation for mrsk
Actualog presentation for mrskActualog
 
1. hungarian club abc
1. hungarian club   abc1. hungarian club   abc
1. hungarian club abckistoff
 
Muerte por powerpoint y como diseñar presentaciones efectivas
Muerte por powerpoint y como diseñar presentaciones efectivasMuerte por powerpoint y como diseñar presentaciones efectivas
Muerte por powerpoint y como diseñar presentaciones efectivasGustavo Parolin
 
презентация готовности
презентация готовностипрезентация готовности
презентация готовностиSokol194
 
Why Your Public Company Doesn't Need Capital Markets Visibility 365
Why Your Public Company Doesn't Need Capital Markets Visibility 365Why Your Public Company Doesn't Need Capital Markets Visibility 365
Why Your Public Company Doesn't Need Capital Markets Visibility 365IR Smartt Inc.
 
Gestor de proyectos docent tic kattia
Gestor de proyectos docent tic kattiaGestor de proyectos docent tic kattia
Gestor de proyectos docent tic kattiaErika Montes
 
Direct and Online marketing
Direct and Online marketingDirect and Online marketing
Direct and Online marketingSyeda Javeria
 

Viewers also liked (20)

Gn the first 24
Gn the first 24Gn the first 24
Gn the first 24
 
z/OS Small Enhancements - Episode 2015A
z/OS Small Enhancements - Episode 2015Az/OS Small Enhancements - Episode 2015A
z/OS Small Enhancements - Episode 2015A
 
Untitleddocument
UntitleddocumentUntitleddocument
Untitleddocument
 
【再放送】バスキュール発!UXデザイン学
【再放送】バスキュール発!UXデザイン学 【再放送】バスキュール発!UXデザイン学
【再放送】バスキュール発!UXデザイン学
 
Jash mehta process modelling
Jash mehta process modellingJash mehta process modelling
Jash mehta process modelling
 
Eitc team 2 tech talk-final
Eitc team 2  tech talk-finalEitc team 2  tech talk-final
Eitc team 2 tech talk-final
 
Digital Video#1
Digital Video#1Digital Video#1
Digital Video#1
 
Actualog presentation for mrsk
Actualog presentation for mrskActualog presentation for mrsk
Actualog presentation for mrsk
 
Vintage music rien Zubaedah
Vintage music rien ZubaedahVintage music rien Zubaedah
Vintage music rien Zubaedah
 
Republikang romano
Republikang romanoRepublikang romano
Republikang romano
 
1. hungarian club abc
1. hungarian club   abc1. hungarian club   abc
1. hungarian club abc
 
Parshal verbs
Parshal verbsParshal verbs
Parshal verbs
 
Muerte por powerpoint y como diseñar presentaciones efectivas
Muerte por powerpoint y como diseñar presentaciones efectivasMuerte por powerpoint y como diseñar presentaciones efectivas
Muerte por powerpoint y como diseñar presentaciones efectivas
 
презентация готовности
презентация готовностипрезентация готовности
презентация готовности
 
Cerveza programa
Cerveza programaCerveza programa
Cerveza programa
 
Why Your Public Company Doesn't Need Capital Markets Visibility 365
Why Your Public Company Doesn't Need Capital Markets Visibility 365Why Your Public Company Doesn't Need Capital Markets Visibility 365
Why Your Public Company Doesn't Need Capital Markets Visibility 365
 
Mechtrix- 2K14
Mechtrix- 2K14Mechtrix- 2K14
Mechtrix- 2K14
 
Gestor de proyectos docent tic kattia
Gestor de proyectos docent tic kattiaGestor de proyectos docent tic kattia
Gestor de proyectos docent tic kattia
 
Rock Alternativo
Rock AlternativoRock Alternativo
Rock Alternativo
 
Direct and Online marketing
Direct and Online marketingDirect and Online marketing
Direct and Online marketing
 

Similar to Call transaction method of BDC

Call session Method of BDC
Call session Method of BDCCall session Method of BDC
Call session Method of BDCRavi Kanudawala
 
SAP Batch data communication
SAP Batch data communicationSAP Batch data communication
SAP Batch data communicationJugul Crasta
 
Recovery of lost or corrupted inno db tables(mysql uc 2010)
Recovery of lost or corrupted inno db tables(mysql uc 2010)Recovery of lost or corrupted inno db tables(mysql uc 2010)
Recovery of lost or corrupted inno db tables(mysql uc 2010)Aleksandr Kuzminsky
 
Recovery of lost or corrupted inno db tables(mysql uc 2010)
Recovery of lost or corrupted inno db tables(mysql uc 2010)Recovery of lost or corrupted inno db tables(mysql uc 2010)
Recovery of lost or corrupted inno db tables(mysql uc 2010)guest808c167
 
Example syntax alv grid list
Example syntax alv grid listExample syntax alv grid list
Example syntax alv grid listNur Khoiri
 

Similar to Call transaction method of BDC (7)

Call session Method of BDC
Call session Method of BDCCall session Method of BDC
Call session Method of BDC
 
SAP Batch data communication
SAP Batch data communicationSAP Batch data communication
SAP Batch data communication
 
Sap scripts
Sap scriptsSap scripts
Sap scripts
 
Recovery of lost or corrupted inno db tables(mysql uc 2010)
Recovery of lost or corrupted inno db tables(mysql uc 2010)Recovery of lost or corrupted inno db tables(mysql uc 2010)
Recovery of lost or corrupted inno db tables(mysql uc 2010)
 
Recovery of lost or corrupted inno db tables(mysql uc 2010)
Recovery of lost or corrupted inno db tables(mysql uc 2010)Recovery of lost or corrupted inno db tables(mysql uc 2010)
Recovery of lost or corrupted inno db tables(mysql uc 2010)
 
Example syntax alv grid list
Example syntax alv grid listExample syntax alv grid list
Example syntax alv grid list
 
Zmalv output type_v1.1
Zmalv output type_v1.1Zmalv output type_v1.1
Zmalv output type_v1.1
 

More from Ravi Kanudawala

More from Ravi Kanudawala (6)

Interview Preparation
Interview PreparationInterview Preparation
Interview Preparation
 
Classical ABAP interactive report
Classical ABAP interactive reportClassical ABAP interactive report
Classical ABAP interactive report
 
Classical report
Classical reportClassical report
Classical report
 
Forecasting Presentation
Forecasting PresentationForecasting Presentation
Forecasting Presentation
 
Alv interactive ABAPreport
Alv interactive ABAPreportAlv interactive ABAPreport
Alv interactive ABAPreport
 
Sap abap report program
Sap abap report programSap abap report program
Sap abap report program
 

Recently uploaded

Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Pooja Bhuva
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17Celine George
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxEsquimalt MFRC
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfNirmal Dwivedi
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxAmanpreet Kaur
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the ClassroomPooky Knightsmith
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxPooja Bhuva
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSCeline George
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024Elizabeth Walsh
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...pradhanghanshyam7136
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfSherif Taha
 

Recently uploaded (20)

Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 

Call transaction method of BDC

  • 1. REPORT ZBDC_003 NO STANDARD PAGE HEADING LINE-SIZE 255. TYPES: BEGIN OF TAB, PERNR TYPE ZTAB_001-PERNR, ENAME TYPE ZTAB_001-ENAME, CITY TYPE ZTAB_001-CITY, END OF TAB. DATA: IT_TAB TYPE TABLE OF TAB, WA_TAB TYPE TAB, D_FILE TYPE STRING, BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE, MESSTAB LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE. PARAMETERS: P_FILE TYPE IBIPPARMS-PATH OBLIGATORY. AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE. CALL FUNCTION 'F4_FILENAME' IMPORTING FILE_NAME = P_FILE. D_FILE = P_FILE. CALL FUNCTION 'GUI_UPLOAD' EXPORTING FILENAME FILETYPE = D_FILE = 'ASC' HAS_FIELD_SEPARATOR * HEADER_LENGTH = 'X' =0
  • 2. * READ_BY_LINE = 'X' * DAT_MODE ='' * CODEPAGE ='' * IGNORE_CERR = ABAP_TRUE * REPLACEMENT = '#' * CHECK_BOM ='' * VIRUS_SCAN_PROFILE = * NO_AUTH_CHECK ='' * IMPORTING * FILELENGTH * HEADER = = TABLES DATA_TAB = IT_TAB EXCEPTIONS FILE_OPEN_ERROR =1 FILE_READ_ERROR =2 NO_BATCH =3 GUI_REFUSE_FILETRANSFER INVALID_TYPE =4 =5 NO_AUTHORITY =6 UNKNOWN_ERROR =7 BAD_DATA_FORMAT =8 HEADER_NOT_ALLOWED =9 SEPARATOR_NOT_ALLOWED HEADER_TOO_LONG = 10 = 11
  • 3. UNKNOWN_DP_ERROR = 12 ACCESS_DENIED = 13 DP_OUT_OF_MEMORY DISK_FULL = 15 DP_TIMEOUT OTHERS = 14 = 16 = 17 . IF SY-SUBRC <> 0. MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. ENDIF. START-OF-SELECTION. *perform open_group. * LOOP AT IT_TAB INTO WA_TAB. PERFORM BDC_DYNPRO USING 'SAPMSVMA' '0100'. PERFORM BDC_FIELD USING 'BDC_CURSOR' 'VIEWNAME'. PERFORM BDC_FIELD USING 'BDC_OKCODE' '=UPD'. PERFORM BDC_FIELD USING 'VIEWNAME' 'ZTAB_001'. PERFORM BDC_FIELD USING 'VIMDYNFLDS-LTD_DTA_NO' 'X'. PERFORM BDC_DYNPRO USING 'SAPLZTAB_001' '0100'. PERFORM BDC_FIELD USING 'BDC_CURSOR' 'ZTAB_001-PERNR(01)'. PERFORM BDC_FIELD USING 'BDC_OKCODE'’=ANZG'. PERFORM BDC_DYNPRO USING 'SAPLZTAB_001' '0100'.
  • 4. PERFORM BDC_FIELD USING 'BDC_CURSOR' 'ZTAB_001-PERNR(01)'. PERFORM BDC_FIELD USING 'BDC_OKCODE' '=AEND'. PERFORM BDC_DYNPRO USING 'SAPLZTAB_001' '0100'. PERFORM BDC_FIELD USING 'BDC_CURSOR' 'ZTAB_001-PERNR(01)'. PERFORM BDC_FIELD USING 'BDC_OKCODE' '=NEWL'. PERFORM BDC_DYNPRO USING 'SAPLZTAB_001' '0100'. PERFORM BDC_FIELD USING 'BDC_CURSOR' 'ZTAB_001-CITY(01)'. PERFORM BDC_FIELD USING 'BDC_OKCODE' '/00'. PERFORM BDC_FIELD USING 'ZTAB_001-PERNR(01)' WA_TAB-PERNR. PERFORM BDC_FIELD USING 'ZTAB_001-ENAME(01)' WA_TAB-ENAME. PERFORM BDC_FIELD USING 'ZTAB_001-CITY(01)' WA_TAB-CITY. PERFORM BDC_DYNPRO PERFORM BDC_FIELD USING 'SAPLZTAB_001' '0100'. USING 'BDC_CURSOR' 'ZTAB_001-PERNR(02)'. PERFORM BDC_FIELD USING 'BDC_OKCODE' '=BACK'. PERFORM BDC_DYNPRO PERFORM BDC_FIELD USING 'SAPLZTAB_001' '0100'. USING 'BDC_CURSOR' 'ZTAB_001-PERNR(02)'. PERFORM BDC_FIELD USING 'BDC_OKCODE' '=BACK'. PERFORM BDC_DYNPRO USING 'SAPLSPO1' '0100'.
  • 5. PERFORM BDC_FIELD USING 'BDC_OKCODE' '=YES'. PERFORM BDC_DYNPRO PERFORM BDC_FIELD USING 'SAPMSVMA' '0100'. USING 'BDC_OKCODE' '/EBACK'. PERFORM BDC_FIELD USING 'BDC_CURSOR' 'VIEWNAME'. PERFORM BDC_TRANSACTION USING 'SM30'. CLEAR: BDCDATA, BDCDATA[]. ENDLOOP. *perform close_group. *&---------------------------------------------------------------------* *& Form bdc_dynpro *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* * -->P_0154 text * -->P_0155 text *----------------------------------------------------------------------* FORM BDC_DYNPRO USING PROGRAM DYNPRO. CLEAR BDCDATA. BDCDATA-PROGRAM = PROGRAM. BDCDATA-DYNPRO = DYNPRO. BDCDATA-DYNBEGIN = 'X'.
  • 6. APPEND BDCDATA. ENDFORM. " bdc_dynpro *&---------------------------------------------------------------------* *& Form bdc_field *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* * -->P_0304 text * -->P_0305 text *----------------------------------------------------------------------* FORM BDC_FIELD USING FNAM FVAL. * IF FVAL <> NODATA. CLEAR BDCDATA. BDCDATA-FNAM = FNAM. BDCDATA-FVAL = FVAL. APPEND BDCDATA. ENDFORM. " bdc_field *&---------------------------------------------------------------------* *& Form bdc_transaction *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* * -->P_0309 text
  • 7. *----------------------------------------------------------------------* FORM BDC_TRANSACTION USING TCODE. REFRESH MESSTAB. CALL TRANSACTION TCODE USING BDCDATA MODE 'E'"CTUMODE UPDATE 'S' "CUPDATE MESSAGES INTO MESSTAB. ENDFORM. *include bdcrecx1. " bdc_transaction