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

BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
The byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxThe byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxShobhayan Kirtania
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 

Recently uploaded (20)

BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
The byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxThe byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptx
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 

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