Filling selection extension using bdc
Hi All,
I'm trying to call a transaction with a big number (>8) of selection-entries.
To do this I'm trying to fill a bdcdata table, somewhat like this:
m_bdc:
'SAPMM08N' '0100' 'X' 'BDC_OKCODE' '%001',
'SAPLALDB' '3000' 'X' 'BDC_OKCODE' 'ACPT',
'SAPLALDB' '3000' ' ' 'RSCSEL-SLOW_I(01)' '9100376753',
'SAPLALDB' '3000' ' ' 'RSCSEL-SLOW_I(02)' '9100376754',
'SAPLALDB' '3000' ' ' 'RSCSEL-SLOW_I(03)' '9100376755',
'SAPLALDB' '3000' ' ' 'RSCSEL-SLOW_I(04)' '9100376756',
'SAPLALDB' '3000' ' ' 'RSCSEL-SLOW_I(05)' '9100376757',
'SAPLALDB' '3000' ' ' 'RSCSEL-SLOW_I(06)' '9100376758',
'SAPLALDB' '3000' ' ' 'RSCSEL-SLOW_I(07)' '9100376759',
'SAPLALDB' '3000' ' ' 'RSCSEL-SLOW_I(08)' '9100376714',
'SAPLALDB' '3000' ' ' 'BDC_CURSOR' 'RSCSEL-SLOW_I(01)',
'SAPLALDB' '3000' ' ' 'BDC_OKCODE' 'LINS',
'SAPLALDB' '3000' ' ' 'RSCSEL-SLOW_I(09)' '9100376524',
'SAPLALDB' '3000' ' ' 'BDC_OKCODE' 'ACPT'.
Problem is that the SAP tries to fill the field RSCSEL-SLOW_I(09) before executing the LINS okcode. This leads to a "not ready for input" error.
Is there a way to force the execution of the okcode LINS, before fillig other fields? Or, is there an alternative to add a selection table of more than 9 lines to transaction call (the SUBMIT alternative won't work since the called program is a modulepool...)
Kind regards from a sunny Holland,
B E R T
PS. TCode is MIR6 (SAP Retail)
During BDC the line item will work like no of lines visible...
actual line item | table controls lines
10 | 1
20 | 2
30 | 3
30 | 4
50 | 5
60 | 6
70 | 7
80 | 8
here insert on page down ok-code
90 | 1
100 | 2
110 | 3
120 | 4
130 | 5
140 | 6
150 | 7
160 | 8
here insert on page down ok-code
170 | 1
while coding we hv to do code for table control line.
regds
gv
Similar Messages
-
Skip the selection screen using BDCTAB call transaction
Hi experts,
I am using BDCTAB for call transaction SWI1 I need to skip the selection screen. Can you please tell me how to skip the selection screen using BDC call transaction?
Thank you in advance.....hi,
the first step is to pass some values to the selection screen, at least Date From and Date To; otherwise, it´ll take a long time. The second step is to emulate the Execute button, which is done with '/08'.
PERFORM fields USING 'BDC_OKCODE' '/08'.
Third step is to catch the programme and screen number. -
REgarding view selection in mm02 while using bdc
hi,
i m using function module 'MATERIAL_BTCI_SELECTION_NEW'' for selecting the single view automatically in bdc,its working fine..but for another scenario i have to select the multiple views so for this what sud i do i how cud i pass multiple views in single parameter 'selection'.
plz help me.
thnx in advance.We had to make a BDC recently for multiple views. For most of them we used BAPI_MATERIAL_SAVEDATA, but there are some views which are not available (Accounting 2 for example).
For others there are some other BAPIs, as BAPI_MATINSPCTRL_SAVEREPLICA for Quality Management, or BAPI_OBJCL_CHANGE fo Classification.
Anyway, for those views that need to be filled using BDC, the better way we have seen is to select at the beginning of BDC the Basic Data 1 view (which is always at the top of the list and is not dependent of the views that are available for a particular material) and then navigate between views with the following OK_CODEs:
Basic data 1 = SP01
Basic data 2 = SP02
External Objects = SP03
Classification = SP04
Sales: Sales Org. Data 1 = SP05
Sales: Sales Org. Data 2 = SP06
Sales: General/Plant Data = SP07
Foreign Trade: Export Data = SP08
Sales and Distribution Text = SP09
Purchasing = SP10
Foreign Trade: Import Data = SP11
Purchase order text = SP12
MRP 1 = SP13
MRP 2 = SP14
MRP 3 = SP15
MRP 4 = SP16
Forecast = SP17
Work scheduling = SP18
Production resources and tools = SP19
General Plant Data / Storage 1 = SP20
General Plant Data / Storage 2 = SP21
Warehouse Management 1 = SP22
Warehouse Management 2 = SP23
Quality Management = SP24
Accounting 1 = SP25
Accounting 2 = SP26
Cost Estimate 1 = SP27
Costing 2 = SP28
Plant stock = SP29
Storage location stock = SP30 -
How to record 'select' action in alv report using BDC technique
hi guys, u r the best;)
my question is: when u select one line in alv report, the line will be high-lighted, right? and suppose there's a button for further processing, then u can click the button to process only this line. ok now, using BDC technique, the system doesn't record the 'select' action! even i go to menu-->select all, it still doesn't work.
or if anybody knows how to release customer expected price except t-code v.25? cuz, i'm trying to record actions in v.25.
thx in advance, u helped me a lot.Hi :
you cannot record ALV using BDC.According to ur req., after u enter data in selection screen, it goes to ALV list , there u select particular record and process further rite, say create in bck ground or foreground.
While doing recording, in selection screen if u have any check box which displays ALV List , uncheck it and continue ur recording.
In the bdc program u can see a field some thing like p_alvlist ' ', mark it as p_alvlist ' / '.
If not, copy the program along with includes, in ur program comment all the alv part, and call that particular FM where this selection takes place from ur main program.
Hope this helps.
Reward points if this is useful.
Thx.
Raghu -
REgarding view selection mm02 in bdc
hi,
i m usung function module 'MATERIAL_BTCI_SELECTION_NEW'' for selecting the single view automatically in bdc,its working fine..but for another scenario i have to select the multiple views so for this what sud i do i how cud i pass multiple views in single parameter 'selection'.
plz help me.
thnx in advance.
nullWe had to make a BDC recently for multiple views. For most of them we used BAPI_MATERIAL_SAVEDATA, but there are some views which are not available (Accounting 2 for example).
For others there are some other BAPIs, as BAPI_MATINSPCTRL_SAVEREPLICA for Quality Management, or BAPI_OBJCL_CHANGE fo Classification.
Anyway, for those views that need to be filled using BDC, the better way we have seen is to select at the beginning of BDC the Basic Data 1 view (which is always at the top of the list and is not dependent of the views that are available for a particular material) and then navigate between views with the following OK_CODEs:
Basic data 1 = SP01
Basic data 2 = SP02
External Objects = SP03
Classification = SP04
Sales: Sales Org. Data 1 = SP05
Sales: Sales Org. Data 2 = SP06
Sales: General/Plant Data = SP07
Foreign Trade: Export Data = SP08
Sales and Distribution Text = SP09
Purchasing = SP10
Foreign Trade: Import Data = SP11
Purchase order text = SP12
MRP 1 = SP13
MRP 2 = SP14
MRP 3 = SP15
MRP 4 = SP16
Forecast = SP17
Work scheduling = SP18
Production resources and tools = SP19
General Plant Data / Storage 1 = SP20
General Plant Data / Storage 2 = SP21
Warehouse Management 1 = SP22
Warehouse Management 2 = SP23
Quality Management = SP24
Accounting 1 = SP25
Accounting 2 = SP26
Cost Estimate 1 = SP27
Costing 2 = SP28
Plant stock = SP29
Storage location stock = SP30 -
Reg Vendor master upload using BDC Call Transaction Method
Hi All,
Thanks in advance.
I am uploading vendor master data using bdc call transaction method for XK01. In that i am getting an error message that the fields " smtp_addr" ( for email) and "time_zone" (for time zone) doesnot exist on the screen '0110' ( this is the second screen) . the field timezone will be displayed on the screen only when we go for communications button and select the URL field .
Do anybody have the solution for this problem. if possible can you give me the code for that screen.Create a recording via SM35 (menu go to=>recording), this will generate automatically the code for filling your bdcdata-table...
-
Problem uploding flatfile in bom(cs01) using bdc recording
Hi,
I had a problem while uploading flatfile records in bom(cs01) by using bdc recording.
I had four records in flatfile(.txt & xl), i.e., header data with its components.
Sample material:
(Header data) (components)
SOFTDRINKS,WIND,1, ' 14','1','ml','l'
SOFTDRINKS,WIND,1, '11','1','ml','l'
SOFTDRINKS,WIND,1, '13','1','ml','l'
SOFTDRINKS,WIND,1, ' 15','1','ml','l'
while executing, the same component entered while recording has been displayed four times not the ff records.
So, i want to know whether whether ff structure is ok or not,
whether coding is correct or not?
report ZBOM1
no standard page heading line-size 255.
*include bdcrecx1.
DATA: BEGIN OF bdc OCCURS 0,
matnr(18),
werks(4),
stlan(1),
END OF BDC.
DATA: BEGIN OF BDC1 OCCURS 0,
idnrk(40),
MENGE(13),
MEINS(3),
postp(1),
END OF bdc1.
DATA: BEGIN OF BDCDATA OCCURS 0,
matnr(18),
werks(4),
stlan(1),
idnrk(18),
MENGE(18),
MEINS(3),
postp(1),
END OF BDCDATA.
data: ibdcdata type standard table of bdcdata with header line.
*start-of-selection.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = 'C:\Documents and Settings\dilipkumar.b\Desktop\soft.txt'
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = ','
HEADER_LENGTH = 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 = BDCDATA
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_READ_ERROR = 2
NO_BATCH = 3
GUI_REFUSE_FILETRANSFER = 4
INVALID_TYPE = 5
NO_AUTHORITY = 6
UNKNOWN_ERROR = 7
BAD_DATA_FORMAT = 8
HEADER_NOT_ALLOWED = 9
SEPARATOR_NOT_ALLOWED = 10
HEADER_TOO_LONG = 11
UNKNOWN_DP_ERROR = 12
ACCESS_DENIED = 13
DP_OUT_OF_MEMORY = 14
DISK_FULL = 15
DP_TIMEOUT = 16
OTHERS = 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.
*perform open_group.
loop at bdcdata.
perform bdc_dynpro using 'SAPLCSDI' '0100'.
perform bdc_field using 'BDC_CURSOR'
'RC29N-STLAN'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'RC29N-MATNR'
'SOFTDRINKS'.
perform bdc_field using 'RC29N-WERKS'
'WIND'.
perform bdc_field using 'RC29N-STLAN'
'1'.
perform bdc_field using 'RC29N-DATUV'
'16.09.2008'.
perform bdc_dynpro using 'SAPLCSDI' '0110'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'RC29K-BMENG'
'1'.
perform bdc_field using 'RC29K-STLST'
'1'.
perform bdc_field using 'BDC_CURSOR'
'RC29K-EXSTL'.
perform bdc_dynpro using 'SAPLCSDI' '0111'.
perform bdc_field using 'BDC_CURSOR'
'RC29K-LABOR'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_dynpro using 'SAPLCSDI' '0140'.
perform bdc_field using 'BDC_CURSOR'
'RC29P-POSTP(01)'.
perform bdc_field using 'BDC_OKCODE'
'=FCBU'.
perform bdc_field using 'RC29P-IDNRK(01)'
'11'.
perform bdc_field using 'RC29P-MENGE(01)'
'1'.
perform bdc_field using 'RC29P-MEINS(01)'
'ml'.
perform bdc_field using 'RC29P-POSTP(01)'
'l'.
perform bdc_dynpro using 'SAPLCSDI' '0130'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'RC29P-POSNR'.
perform bdc_field using 'RC29P-POSNR'
'0010'.
perform bdc_field using 'RC29P-IDNRK'
'11'.
perform bdc_field using 'RC29P-MENGE'
'1'.
perform bdc_field using 'RC29P-MEINS'
'ML'.
perform bdc_dynpro using 'SAPLCSDI' '0131'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'RC29P-POTX1'.
perform bdc_field using 'RC29P-SANKA'
'X'.
*perform bdc_transaction using 'CS01'.
*perform close_group.
CALL TRANSACTION 'CS01' USING IBDCDATA MODE 'A' UPDATE 'S'.
REFRESH IBDCDATA.
endloop.
Start new screen *
FORM BDC_DYNPRO USING PROGRAM DYNPRO.
CLEAR iBDCDATA.
iBDCDATA-PROGRAM = PROGRAM.
iBDCDATA-DYNPRO = DYNPRO.
iBDCDATA-DYNBEGIN = 'X'.
APPEND ibDCDATA .
ENDFORM.
Insert field *
FORM BDC_FIELD USING FNAM FVAL.
IF FVAL <> NODATA.
CLEAR iBDCDATA.
iBDCDATA-FNAM = FNAM.
iBDCDATA-FVAL = FVAL.
APPEND iBDCDATA .
ENDIF.Hi Dilip,
You are reading your flat file into an internal table, you perform a LOOP over the read itab, but you are not using your BDCDATA data anywhere into IBDCDATA internal table! Those data have to be filled into FVAL parameter.
Here an additional hint:
1. The content of flat file is delivered as a STRING in GUI_UPLOAD. First you have to post these values into a structured internal table. And then perform the LOOP at this structured table.
2. In the new ABAP concept newer ever user Header Lines (in an internal table). One reason: Header Lines are not allowed in ABAP Objects. Instead use
LOOP AT itab into wa_structure.
*do something with wa_structure
APPEND wa_structure to IBDCDATA.
ENDLOOP.
Good success,
Heinz -
Default sales org on selection screen using set and get parameter!!
Hi,
I need to default value on selection screen using SET n GET parameter...logic to be used should be:
Sales Organisation:
This field should be filled by default using the user parameter id VKO. (using sentence GET PARAMETER and SET PARAMETER)...
Hope i need to write the code in initialisation and what shud b the content?
Regards
Gunjanhi,
TABLES <table name>.
SET PARAMETER ID VKO FIELD <tablename-fieldname>.
call transaction 'zxx'.
try this sample program,
REPORT BOOKINGS NO STANDARD PAGE HEADING.
TABLES SBOOK.
START-OF-SELECTION.
WRITE: 'Select a booking',
SKIP.
GET SBOOK.
WRITE: SBOOK-CARRID, SBOOK-CONNID,
SBOOK-FLDATE, SBOOK-BOOKID.
HIDE: SBOOK-CARRID, SBOOK-CONNID,
SBOOK-FLDATE, SBOOK-BOOKID.
AT LINE-SELECTION.
SET PARAMETER ID: 'CAR' FIELD SBOOK-CARRID,
'CON' FIELD SBOOK-CONNID,
'DAY' FIELD SBOOK-FLDATE,
'BOK' FIELD SBOOK-BOOKID.
CALL TRANSACTION 'BOOK'.
regards,
siva
Message was edited by:
Shan -
Data upload for vendor balances using BDC
hi abap experts,
I have a requirement on data uploading using BDC.
For the vendor balances ie. for transaction FBL1N ( I was given a template for vendor balance upload and need to write a BDC program for that ) I need upload the exsisting transaction data to the system. is recording necessary for this?
can u pls help me with step by step process for vendor balance uploading.
Thanks,
Hema.Hi
Please follow the following Steps:
Steps for recording:
Step1: Goto TCODE SHDB
Step2: Click on New Recording
Step3: Give the necessary Details such as TOCDE, Desc, ...
Step4: Do the screen by screen recording.(Please avoid extra screen to appear)
Step5: Save the recording.
Step6. Select the recording and click on Program button on toolbar.
Step7: Give the Program name and click on radio button Transfer from recording.
Step 8: It will open a new session with SE38 and a program with the recoding.
Step 9: then just add the basic code for BDC.
Regards,
Lokesh -
I want in LSMW SAME CODING. THIS IS USING BDC CALL TRANSACTION
REPORT ZXX_BDC_PRA NO STANDARD PAGE HEADING LINE-COUNT 20
LINE-SIZE 150 .
Program Name :ZXX_BDC_PRA *
Object Id : *
Develper Name : praveen *
Start Date : 25.06.07 *
Description : uploading flat file to sap system *
*--structure for Data Uploading.
DATA: BEGIN OF IT_STR ,
VKORG LIKE RF02D-VKORG,
VTWEG LIKE RF02D-VTWEG,
SPART LIKE RF02D-SPART,
KTOKD LIKE RF02D-KTOKD,
NAME1 LIKE KNA1-NAME1,
SORTL LIKE KNA1-SORTL,
ORT01 LIKE KNA1-ORT01,
PSTLZ LIKE KNA1-PSTLZ,
LAND1 LIKE KNA1-LAND1,
SPRAS LIKE KNA1-SPRAS,
END OF IT_STR.
*--Internal Table for Data Uploading.
DATA: ITAB LIKE IT_STR OCCURS 0.
*--Internal Table to sucessfull Records.
DATA: ITAB1 LIKE IT_STR OCCURS 0.
*--Internal Table to Store Error Records.
DATA: ITAB2 LIKE STANDARD TABLE OF IT_STR WITH HEADER LINE.
*--Internal Table for Storing the BDC data.
DATA: BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE.
*--Internal Table for storing the messages.
DATA: MESSTAB LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.
DATA: COUNT TYPE I VALUE 1,
S VALUE 0, E VALUE 0.
Selection screen *
SELECTION-SCREEN BEGIN OF BLOCK b1
WITH FRAME TITLE TEXT-001.
PARAMETERS: P_FILE TYPE IBIPPARMS-PATH.
SELECTION-SCREEN END OF BLOCK B1.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
*functionality to use drill down list
CALL FUNCTION 'F4_FILENAME'
EXPORTING
PROGRAM_NAME = SYST-CPROG
DYNPRO_NUMBER = SYST-DYNNR
IMPORTING
FILE_NAME = P_FILE.
Start-of-selection *
START-OF-SELECTION.
DATA FILENAME TYPE STRING.
FILENAME = P_FILE.
*-- Form to upload flatfile data into the internal table.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = FILENAME
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = 'X'
TABLES
DATA_TAB = ITAB
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_READ_ERROR = 2
NO_BATCH = 3
GUI_REFUSE_FILETRANSFER = 4
INVALID_TYPE = 5
NO_AUTHORITY = 6
UNKNOWN_ERROR = 7
BAD_DATA_FORMAT = 8
HEADER_NOT_ALLOWED = 9
SEPARATOR_NOT_ALLOWED = 10
HEADER_TOO_LONG = 11
UNKNOWN_DP_ERROR = 12
ACCESS_DENIED = 13
DP_OUT_OF_MEMORY = 14
DISK_FULL = 15
DP_TIMEOUT = 16
OTHERS = 17.
*--Generating the BDC table for the fields of the internal table.
LOOP AT ITAB INTO IT_STR.
PERFORM BDC_DYNPRO USING 'SAPMF02D' '0107'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'RF02D-KTOKD'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'/00'.
PERFORM BDC_FIELD USING 'RF02D-VKORG'
IT_STR-VKORG.
PERFORM BDC_FIELD USING 'RF02D-VTWEG'
IT_STR-VTWEG.
PERFORM BDC_FIELD USING 'RF02D-SPART'
IT_STR-SPART.
PERFORM BDC_FIELD USING 'RF02D-KTOKD'
IT_STR-KTOKD.
PERFORM BDC_DYNPRO USING 'SAPMF02D' '0110'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'KNA1-SPRAS'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'/00'.
PERFORM BDC_FIELD USING 'KNA1-NAME1'
IT_STR-NAME1.
PERFORM BDC_FIELD USING 'KNA1-SORTL'
IT_STR-SORTL.
PERFORM BDC_FIELD USING 'KNA1-ORT01'
IT_STR-ORT01.
PERFORM BDC_FIELD USING 'KNA1-PSTLZ'
IT_STR-PSTLZ.
PERFORM BDC_FIELD USING 'KNA1-LAND1'
IT_STR-LAND1.
PERFORM BDC_FIELD USING 'KNA1-SPRAS'
IT_STR-SPRAS.
PERFORM BDC_DYNPRO USING 'SAPMF02D' '0120'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'KNA1-TXJCD'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'/00'.
PERFORM BDC_DYNPRO USING 'SAPMF02D' '0125'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'KNA1-NIELS'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'/00'.
PERFORM BDC_DYNPRO USING 'SAPMF02D' '0360'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'KNVK-NAMEV(01)'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=ENTR'.
PERFORM BDC_DYNPRO USING 'SAPMF02D' '0310'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'KNVV-BEGRU'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'/00'.
PERFORM BDC_DYNPRO USING 'SAPMF02D' '0324'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'KNVP-PARVW(01)'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=ENTR'.
*--Calling the transaction 'Vd01'.
CALL TRANSACTION 'VD01' USING BDCDATA MODE 'N' UPDATE 'S'
MESSAGES INTO MESSTAB.
PERFORM MESSAGES.
REFRESH : BDCDATA, MESSTAB.
ENDLOOP.
END-OF-SELECTION.
*--Populating the Success records internal table.
IF ITAB1[] IS NOT INITIAL.
format color 5.
WRITE: /'SUCCESSFUL RECORDS'.
format color off.
LOOP AT ITAB1 INTO IT_STR.
WRITE:/ IT_STR-VKORG,IT_STR-VTWEG,
IT_STR-SPART,IT_STR-KTOKD,
IT_STR-NAME1,IT_STR-SORTL,
IT_STR-ORT01,
IT_STR-PSTLZ,
IT_STR-LAND1,
IT_STR-SPRAS.
S = S + 1.
ENDLOOP.
REFRESH : ITAB1.
WRITE:/ 'TOTAL RECORDS',S.
ENDIF.
*--Populating the error records internal table.
IF ITAB2[] IS NOT INITIAL.
FORMAT COLOR 3.
WRITE :/ 'ERRORS RECORDS ARE'.
FORMAT COLOR OFF.
LOOP AT ITAB2.
WRITE:/ ITAB2-VKORG,
ITAB2-VTWEG,
ITAB2-SPART,ITAB2-KTOKD,
ITAB2-NAME1,ITAB2-SORTL,
ITAB2-ORT01,
ITAB2-PSTLZ,
ITAB2-LAND1,
ITAB2-SPRAS.
E = E + 1.
ENDLOOP.
REFRESH : ITAB2.
WRITE: / 'TOTAL RECORDS',E.
REFRESH : ITAB2.
ENDIF.
End of Selection *
END-OF-SELECTION.
TOP-OF-PAGE *
TOP-OF-PAGE.
WRITE:/ SY-ULINE.
WRITE:/10 'REPORT ID',21 SY-REPID,35 'USERNAME',46 SY-UNAME,
60 'SYSTEM DATE',70 SY-DATUM,80 'SYSTEM TIME',90 SY-UZEIT,
100 'PAGE NO',108 SY-PAGNO.
WRITE:/ SY-ULINE.
FOrm to Populate the BDC table.
Start new screen *
FORM BDC_DYNPRO USING PROGRAM DYNPRO.
CLEAR BDCDATA.
BDCDATA-PROGRAM = PROGRAM.
BDCDATA-DYNPRO = DYNPRO.
BDCDATA-DYNBEGIN = 'X'.
APPEND BDCDATA.
ENDFORM. "BDC_DYNPRO
Insert field *
FORM BDC_FIELD USING FNAM FVAL.
IF FVAL <> SPACE.
CLEAR BDCDATA.
BDCDATA-FNAM = FNAM.
BDCDATA-FVAL = FVAL.
APPEND BDCDATA.
ENDIF.
ENDFORM. "BDC_FIELD
*& Form messages
FORM MESSAGES .
LOOP AT MESSTAB.
IF MESSTAB-MSGTYP = 'I'.
WRITE : / MESSTAB-MSGV1.
ELSEIF
MESSTAB-MSGTYP = 'S'.
INSERT LINES OF ITAB FROM COUNT TO COUNT INTO TABLE ITAB1 .
COUNT = COUNT + 1.
WRITE : / MESSTAB-MSGV1.
ELSEIF
MESSTAB-MSGTYP = 'E'.
INSERT LINES OF ITAB FROM COUNT TO COUNT INTO TABLE ITAB2.
COUNT = COUNT + 1.
WRITE : / MESSTAB-MSGV1.
ENDIF.
ENDLOOP.
ENDFORM. " messagesHi
Go through the doc and do the same using LSMW
BDC is the way to transfer data by writing a batch input program which can use either session or call transaction method.
LSMW used to transfer data without/less code.
What type of data we transfer using LSMW?
LSMW is best suited for transferring master data.
Actually BDC and LSMW are not comparable at all.
for example LSMW itself can use BDC as a way of mass data transfer.
BDC is a mass data transfer technique via screen logic of existing SAP Data entry transactions. It behaves as if you are manually making thousand of entires into sap system as a background job. And that is probably the reason why BAPI's are preffered over BDC's.
On the other hand LSMW is a tool to facilitate DATA migration from other legacy systems ... It contains step by step procedure for data migration.
Like Managing Data Migration Projects , Creating Source Structures , Mapping Source structures wid Target structures , etc etc
LSMW internally might well be using the following techniqes for data transfer..
1. IDOX
2. Direct Input / BDC
4. BAPI's
LSMW is an encapsulated data transfer tool. It can provide the same functionality as BDC infact much more but when coming to techinical perspective most the parameters are encapulated. To listout some of the differences :
LSMW is basicaly designed for a fuctional consultant who do not do much coding but need to explore the fuctionality while BDC is designed for a technical consultant.
LSMW offers different techinque for migrating data: Direct input ,BAPI,Idoc,Batch input recording. While bdc basically uses recording.
LSMW mapping is done by SAP while in BDC we have to do it explicitly .
LSMW is basically for standard SAP application while bdc basically for customized application.
Coding can be done flexibly in BDC when compared to LSMW
1. Maintain Attributes:
Here you have to choose the second option and you can do the recording how this should work. Then assign the same to the Batch Input Recording name.
2. Maintain Source structure:
Create a structure name
3. Maintain Source field:
In this you have to create a structure same as that of the input file
eg: name
age
4. Maintain structure relations:
This will link the structure to the input file.
5. Maintain field mapping and conversion rules:
Here is the place where you can do coding, depending upon the code you have written or assignment you have done the values will get picked up from the file and get processed.
6. Maintain field mapping and conversion rules:
If you have any fixed values you can define here.
7. Specify files:
Specify the input file path and type.
8. Assign files:
This will assign ur file to the Input file
9. Read Data:
This will read ur data from teh file.
10. Dispaly Read Data:
You can see the uploaded data
11. Convert Data
This will convert the data to the corresponding format for processing
12. Display Converted data:
13. Create batch input session
Here this will create a batch input session for processing
14. Run Batch Input session:
By clicking on the session and process the same you can do teh needfu.
http://www.sapbrain.com/TOOLS/LSMW/SAP_LSMW_steps_introduction.html
http://esnips.com/doc/8e732760-5548-44cc-a0bb-5982c9424f17/lsmw_sp.ppt
http://esnips.com/doc/f55fef40-fb82-4e89-9000-88316699c323/Data-Transfer-Using-LSMW.zip
http://esnips.com/doc/1cd73c19-4263-42a4-9d6f-ac5487b0ebcb/LSMW-with-Idocs.ppt
http://esnips.com/doc/ef04c89f-f3a2-473c-beee-6db5bb3dbb0e/LSMW-with-BAPI.ppt
http://esnips.com/doc/7582d072-6663-4388-803b-4b2b94d7f85e/LSMW.pdf
for Long texts Upload
Please take a look at this..
http://help.sap.com/saphelp_erp2005/helpdata/en/e1/c6d30210e6cf4eac7b054a73f8fb1d/frameset.htm
Reward points for useful Answers
Regards
Anji -
Call transaction using bdc tab and also skip first screen??
Hi,
Please help.
I want to call transaction PA30 fill it with values which are determined only at runtime and then skip first screen.
The screen doesn't have parameter fields so i cannot use 'set parameter id'.
I also cannot create a transaction with parameters as I only have these at runtime.
Anyone done anything like this???hi,
you might be populateing the itab bdc_tab with the corresponding values fronm the recording.
while doing the recording go until to the screen wher u want to finsih.
and populate the bdc_tab wit the ok code,screen number and the value.
this will do.
for eg see the code below.
METHOD analyze_log.
DATA : wrk_extid TYPE balhdr-extnumber.
DATA : wrk_date(10) TYPE c.
DATA : it_rspar TYPE TABLE OF rsparams .
DATA : wa_rspar TYPE rsparams.
DATA: it_bdcdata TYPE STANDARD TABLE OF bdcdata,
wa_bdcdata TYPE bdcdata.
DATA: params TYPE ctu_params.
CONSTANTS : object TYPE balhdr-object VALUE 'ZKIV_LOG'.
IF wa_kopf-vertr_nr IS NOT INITIAL.
CONCATENATE wa_kopf-vertr_nr '/' wa_kopf-nachtr_nr INTO wrk_extid.
wrk_date = '01.09.2006'.
SET PARAMETER ID 'BALOBJ' FIELD object .
SET PARAMETER ID 'BALEXT' FIELD wrk_extid.
wa_rspar-selname = 'ALDATE'.
wa_rspar-sign = 'I'.
wa_rspar-kind = 'P'.
wa_rspar-option = 'EQ'.
wa_rspar-low = wrk_date.
APPEND wa_rspar TO it_rspar.
ELSE.
CLEAR wrk_extid.
SET PARAMETER ID 'BALEXT' FIELD wrk_extid.
ENDIF.
Update BDC tab
--Call SLG1 using BDC--&
params-dismode = 'E'. "Show errors only
CLEAR wa_bdcdata.
wa_bdcdata-program = 'SAPLSLG3'.
wa_bdcdata-dynpro = '0100'.
wa_bdcdata-dynbegin = 'X'.
APPEND wa_bdcdata TO it_bdcdata.
CLEAR wa_bdcdata.
wa_bdcdata-fnam = 'BDC_CURSOR'.
wa_bdcdata-fval = 'BALHDR-ALDATE'.
APPEND wa_bdcdata TO it_bdcdata.
CLEAR wa_bdcdata.
wa_bdcdata-fnam = 'BALHDR-ALDATE'.
wa_bdcdata-fval = wrk_date.
APPEND wa_bdcdata TO it_bdcdata.
CLEAR wa_bdcdata.
wa_bdcdata-fnam = 'BDC_OKCODE'.
wa_bdcdata-fval = '=SELE'.
APPEND wa_bdcdata TO it_bdcdata.
CLEAR wa_bdcdata.
wa_bdcdata-program = 'SAPLSLG3'.
wa_bdcdata-dynpro = '0100'.
wa_bdcdata-dynbegin = 'X'.
APPEND wa_bdcdata TO it_bdcdata.
CLEAR wa_bdcdata.
wa_bdcdata-fnam = 'BDC_OKCODE'.
wa_bdcdata-fval = '=&F03'.
APPEND wa_bdcdata TO it_bdcdata.
CLEAR wa_bdcdata.
wa_bdcdata-fnam = 'BDC_SUBSCR'.
wa_bdcdata-fval = 'SAPLSBAL_DISPLAY 0101SUBSCREEN'.
APPEND wa_bdcdata TO it_bdcdata.
CALL TRANSACTION 'SLG1' USING it_bdcdata OPTIONS FROM params.
--End of BDC--&
ENDMETHOD.
here wat i m doing is that i dont want the subscreen 101 to be displayed..
Message was edited by:
Sandeep S -
Creation of po with mutiple line items using BDC
Hi Gurus,
Can any body hav notes for creating po's using BDC with multiple line items in transaction ME21. I hav created po for single line item but if i tried to create multiple line items, it ll create multiple po's...
thanks in advance
arunSee the Below Logic for me22 and it is also same for me21
report zpochange.
data : i_error like bdcmsgcoll occurs 0 with header line.
data : i_bdcdata like bdcdata occurs 0 with header line.
tables : ekko, ekpo.
data :c1(10) value 'ME22',
c2(1) value ',',c3(10).
data : var1(20). " LIKE EKKO-EBELN.
data : var2 like ekko-ebeln.
data : begin of i_ekko occurs 0,
header(2),
ebeln like ekko-ebeln,
end of i_ekko.
data : begin of i_ekpo occurs 0,
item(2),
ebeln like ekpo-ebeln,
ebelp like ekpo-ebelp,
menge(10), " LIKE EKPO-MENGE,
end of i_ekpo.
data : v like ekpo-ebelp.
data: begin of itab occurs 0,
text(300),
end of itab.
parameters: p_file like ibipparms-path.
*PARAMETERS: PONUMBER LIKE EKPO-EBELN.
at selection-screen on value-request for p_file.
call function 'F4_FILENAME'
exporting
program_name = syst-cprog
dynpro_number = syst-dynnr
FIELD_NAME = ' '
importing
file_name = p_file
start-of-selection.
*SELECT EBELN FROM EKKO INTO TABLE I_EKKO WHERE EBELN = PONUMBER.
SELECT EBELN EBELP MENGE FROM EKPO INTO TABLE I_EKPO WHERE EBELN
*= PONUMBER.
perform get_data.
*LOOP AT ITAB.
WRITE :/ ITAB.
ENDLOOP.
loop at itab.
var1 = itab-text+0(1).
if var1 = 'H'.
*I_EKKO-EBELN = ITAB-TEXT.
split itab at c2 into i_ekko-header
i_ekko-ebeln.
SPLIT ITAB AT ',' INTO I_EKKO-EBELN.
" I_EKPO-EBELP
" I_EKPO-MENGE
" var1.
append i_ekko.
else.
split itab at c2 into i_ekpo-item
i_ekpo-ebeln
i_ekpo-ebelp
i_ekpo-menge.
append i_ekpo.
endif.
*var2 = i_ekpo-ebeln.
MOVE VAR1 TO I_EKPO-EBELN.
MOVE VAR1 TO I_EKKO-EBELN.
APPEND: I_EKPO.
*if not var1 is initial.
split var1 at ',' into i_ekpo-ebelp
i_ekpo-menge.
i_ekpo-ebeln = var2.
append i_ekpo.
*endif.
endloop.
loop at i_ekpo.
write :/ i_ekpo.
endloop.
loop at i_ekko.
perform fill_data. " TABLES I_EKPO.
endloop.
LOOP AT I_EKPO.
WRITE :/ I_EKPO.
ENDLOOP.
*& Form GET_DATA
text
--> p1 text
<-- p2 text
*LOOP AT I_ERROR.
WRITE :/ I_ERROR.
ENDLOOP.
form get_data.
call function 'WS_UPLOAD'
exporting
codepage = ' '
filename = p_file
filetype = 'ASC'
headlen = ' '
line_exit = ' '
trunclen = ' '
user_form = ' '
user_prog = ' '
dat_d_format = ' '
IMPORTING
FILELENGTH =
tables
data_tab = itab
exceptions
conversion_error = 1
file_open_error = 2
file_read_error = 3
invalid_type = 4
no_batch = 5
unknown_error = 6
invalid_table_width = 7
gui_refuse_filetransfer = 8
customer_error = 9
others = 10
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
endform. " GET_DATA
*& Form FILL_DATA
text
-->P_I_EKPO text
form fill_data. " tables i_ekpo .
perform bdcscreen using 'SAPMM06E' '0105'.
perform bdcfield using 'RM06E-BSTNR' i_ekko-ebeln.
perform bdcfield using 'BDC_OKCODE' '/00'.
loop at i_ekpo where ebeln = i_ekko-ebeln.
V = I_EKPO-EBELP.
perform bdcscreen using 'SAPMM06E' 0120.
perform bdcfield using 'BDC_CURSOR' 'RM06E-EBELP'.
perform bdcfield using 'RM06E-EBELP' i_ekpo-ebelp.
perform bdcfield using 'BDC_OKCODE' '/00'.
perform bdcscreen using 'SAPMM06E' 0120.
perform bdcfield using 'BDC_CURSOR' 'EKPO-MENGE(01)'.
perform bdcfield using 'RM06E-EBELP' i_ekpo-ebelp.
perform bdcfield using 'EKPO-MENGE(01)' i_ekpo-menge.
perform bdcfield using 'BDC_OKCODE' '/00'.
*PERFORM BDCSCREEN USING 'SAPMM06E' 0120.
*PERFORM BDCFIELD USING 'BDC_CURSOR' 'RMO6E-EBELP'.
*CLEAR V.
endloop.
perform bdcfield using 'BDC_OKCODE' '=BU'.
call transaction c1 using i_bdcdata mode 'A'
messages into i_error.
refresh i_bdcdata.
endform. " FILL_DATA
*& Form BDCSCREEN
text
-->P_0140 text
-->P_0120 text
form bdcscreen using p_program p_screen.
i_bdcdata-program = p_program.
i_bdcdata-dynpro = p_screen.
i_bdcdata-dynbegin = 'X'.
append i_bdcdata.
clear i_bdcdata.
endform. " BDCSCREEN
*& Form BDCFIELD
text
-->P_0145 text
-->P_I_EKPO_EBELN text
form bdcfield using fnam fval.
i_bdcdata-fnam = fnam.
i_bdcdata-fval = fval.
append i_bdcdata.
clear i_bdcdata.
endform. " BDCFIELD
Reward Points if it is helpful
Thanks
Seshu -
Creation of PO using BDC with ME21N - Urgent
Hi All,
My requirement is to create a Purchase Order using BDC. I'm using ME21N for BDC. I did recording and using that recording I wrote a program for BDC. BDC table is populated correctly, but while calling ME21N using call transaction, program is cuming back to the selection screen, without creating PO. And sy-subrc value after call transaction is '0'. Please let me know the problem.
Thanks in Advance.
Siva Sankar.Hi,
Put a break point after the call transaction statement(i.e, put break point on sy-subrc check)
and then check the message table.
if call transaction is suceessfull u will find a success messages in the I_messages table.
Regards,
Sriram -
Change transaction using BDC-problem for large number of lines on screen
Hi All,
I am developing BAPI (using BDC) which creates quality notification in SAP which is entered via front end web application. Structure p_qmsm contain 3 lines of task in notification. The code is as given below. To avoid problem of large no of lines on screen,code lines starting with * is used. This actually for pagedown after entering every 2 lines and creates new line. so that 2 lines always push up on screen and there will not be problem for creating large no of lines on screen
perform bdc_dynpro using 'SAPLIQS0' '7200'.
perform bdc_field using 'BDC_OKCODE' '=10\TAB11'.
LOOP AT p_qmsm INTO wa_qmsm.
*IF wa_qmsm_cntr > 2.
wa_qmsm_cntr = 2.
perform bdc_dynpro using 'SAPLIQS0' '7204'.
perform bdc_field using 'BDC_OKCODE' '=PEND'.
ENDIF.
perform bdc_dynpro using 'SAPLIQS0' '7204'.
perform bdc_field using 'BDC_OKCODE' '/00'.
CONCATENATE 'VIQMSM-QSMNUM(' wa_qmsm_cntr ')' INTO wm_qmsm_qsmnum.
CONCATENATE 'VIQMSM-MNGRP(' wa_qmsm_cntr ')' INTO wm_qmsm_mngrp.
CONCATENATE 'VIQMSM-MNCOD(' wa_qmsm_cntr ')' INTO wm_qmsm_mncod.
CONCATENATE 'VIQMSM-MATXT(' wa_qmsm_cntr ')' INTO wm_qmsm_matxt.
perform bdc_field using wm_qmsm_qsmnum wa_qmsm-qsmnum.
perform bdc_field using wm_qmsm_mngrp wa_qmsm-mngrp.
perform bdc_field using wm_qmsm_mncod wa_qmsm-mncod.
perform bdc_field using wm_qmsm_matxt wa_qmsm-matxt.
wa_qmsm_cntr = wa_qmsm_cntr + 01.
ENDLOOP.
CALL TRANSACTION 'IQS2' USING wt_bdc
MODE 'N' UPDATE 'A' MESSAGES INTO P_MESSTAB.
The same code is used in modify mode also. web application is sending all 3 lines in modify mode even if single line is modified. It is already decided to send all rows back from web application to SAP in same sequence. It is working fine if i comment 5 lines which is starting with *. But in modify mode, how can i ensure that correct row is modified? and how can i achieve problem of large no of lines on screen?Please suggest?Hi yogesh,
how can i ensure that correct row is modified?
1. For this we need to know two things ;
a) the database table in which the entries are already stored
b) the sequence in which they are displayed in the transaction.
2. So before changing any line, we need to compare (the primary key values / important values)
a) as per the database table and as per the incoming data from web application (using bapi)
b) if the match is ok, it means that particular row was not modified, else modified.
how can i achieve problem of large no of lines on screen?
1. For this I am not sure about the transaction and its screen. Manytimes for appending row on the screen,
there is a PLUS + button on the grid toolbar. So for every entry, (inspite of some empty/filled rows already visible on the screen), we should use the + button, and this new row always appears on the top i.e. row number 1.
hope this helps.
regards,
amit m. -
TSW-Ticket Creation & Actualization using BDC
Hi,
I am using BDC for Ticket creation using transaction O4TEN.
After execution of this BDC, Ticket get created and Saved but it does not actualize ticket even if we click actualize button using BDC.
In real scenario, after ticket creation the status and substatus values should be "C"(Planned) and "6" (Complete) but in this case the status and substatus values are "B"(Checked) and "4"(Positive).
If we create ticket directly using O4TEN then it actualizes ticket properly.
I am not able to find out why BDC is not actualizing tickets.
Any idea?
Regards,
UmeshHi,
I tried BDC for SAVE but still not getting Ticket Key.
So now I am using FM: OIJ_EL_A_TICKETS_MAINTAIN_N.
It creates ticket but in Ticket Item table Ticket item field is blank. Purpose is blank.
Also OIJ_EL_TKT_I_O1 and OIJ_EL_TKT_I_O2 are not populated.
In header I am passing: TICKET_PURPOSE, TICKET_TYPE, UPDKZ = 'I'
and In item I am passing: NOMNR, NOMTK, NOMIT, MENGE, MEINS, TIME_ST_LOAD_STA, TIME_ST_LOAD_END, BUDAT UPDKZ = 'I'.
am I missing something?
Code is as follows:
Replace BDC with function module: OIJ_EL_A_TICKETS_MAINTAIN_N
1) Call FM: OIJ_EL_A_TICKETS_MAINTAIN_N
2) Call FM: ENQUEUE_E_OIJTKT
3) Call FM: OIJB_GENERATE_DOCUMENTS_N
4) Call FM: DEQUEUE_E_OIJTKT
DATA: ls_tkt_h TYPE roij_el_ticket_hvb,
ls_tkt_i TYPE roij_el_ticket_i_io,
ls_oijnomi TYPE oijnomi,
ls_roijnomiio TYPE roijnomiio,
ls_ticket_item TYPE oij_el_ticket_i,
ls_ticket_item_o1 TYPE oij_el_tkt_i_o1,
ls_ticket_item_o2 TYPE oij_el_tkt_i_o2,
ls_ticket_header_pv TYPE oij_el_ticket_h,
ls_ticket_header TYPE oij_el_ticket_h,
ls_tkt_i_o1 TYPE oij_el_tkt_i_o1,
ls_tkt_i_o2 TYPE oij_el_tkt_i_o2.
DATA: lv_time TYPE sy-uzeit.
DATA: it_tkt_i TYPE roij_el_ticket_i_io_t,
it_tkt_h_evt TYPE roijte_t,
it_tkt_h_evt_txt TYPE oij_txt,
it_tkt_i_evt TYPE roijte_t,
it_tkt_i_evt_txt TYPE oij_txt,
it_tkt_i_o1 TYPE roij_el_tkt_i_o1_t,
it_tkt_i_o2 TYPE roij_el_tkt_i_o2_t,
it_tkt_err_log TYPE oij_el_err_log_tt,
it_tkt_doc_flow TYPE roij_el_doc_flow_io_t,
it_return TYPE bapiret2_t,
it_oijnomh TYPE oijnomh_t,
it_oijnomi TYPE oijnomi_t,
it_ticket_item TYPE STANDARD TABLE OF oij_el_ticket_i,
it_ticket_item_o1 TYPE STANDARD TABLE OF oij_el_tkt_i_o1,
it_ticket_item_o2 TYPE STANDARD TABLE OF oij_el_tkt_i_o2.
ls_tkt_h-ticket_purpose = '1'.
ls_tkt_h-ticket_type = lv_ticket_type.
IF lv_ticket_type EQ c_yp2.
If Ticket type is YP2 then
ls_tkt_h-yy_mct_cat = fp_mct_cat.
ENDIF.
ls_tkt_h-yy_pat_alc = lv_alloc_rule.
ls_tkt_h-updkz = 'I'.
ls_tkt_i-nomnr = fp_s_tc1-nomnr.
ls_tkt_i-nomtk = fp_s_tc1-nomtk.
ls_tkt_i-nomit = fp_s_tc1-nomit.
ls_tkt_i-menge = lv_menge.
ls_tkt_i-meins = fp_s_tc1-units.
CLEAR ls_oijnomi.
SELECT SINGLE * FROM oijnomi INTO ls_oijnomi
WHERE nomtk = fp_s_tc1-nomtk
AND nomit = fp_s_tc1-nomit.
IF sy-subrc EQ 0.
MOVE-CORRESPONDING ls_oijnomi TO ls_roijnomiio.
ENDIF.
PERFORM get_timestamp USING fp_sdate
lv_time
ls_roijnomiio
CHANGING ls_tkt_i-time_st_load_sta.
PERFORM get_timestamp USING fp_edate
lv_time
ls_roijnomiio
CHANGING ls_tkt_i-time_st_load_end.
CONCATENATE lv_budat(4) lv_budat5(2) lv_budat8(2) INTO ls_tkt_i-budat.
ls_tkt_i-updkz = 'I'.
APPEND ls_tkt_i TO it_tkt_i.
CALL FUNCTION 'OIJ_EL_A_TICKETS_MAINTAIN_N'
EXPORTING
is_tkt_header = ls_tkt_h
IT_HEADER_EVT =
IT_HEADER_EVT_TXT =
it_items = it_tkt_i
IT_ITM_EVT =
IT_ITM_EVT_TXT =
IT_ITM_O1 =
IT_ITM_O2 =
IT_TKT_ERROR_LOG =
it_tkt_doc_flow = it_tkt_doc_flow
iv_commit = 'X'
IV_LOCK =
IV_ADD_TO_LOG =
IV_CALL_TO_OUTPUT =
IMPORTING
es_tkt_header = ls_tkt_h
ET_HEADER_EVT = it_tkt_h_evt
ET_HEADER_EVT_TXT = it_tkt_h_evt_txt
et_items = it_tkt_i
ET_ITM_EVT = it_tkt_i_evt
ET_ITM_EVT_TXT = it_tkt_i_evt_txt
et_itm_o1 = it_tkt_i_o1
et_itm_o2 = it_tkt_i_o2
ET_TKT_ERROR_LOG = it_tkt_err_log
et_tkt_doc_flow = it_tkt_doc_flow
et_return = it_return
EXCEPTIONS
ticket_locked = 1
OTHERS = 2
IF sy-subrc NE 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ELSE.
COMMIT WORK AND WAIT.
Lock the ticket
There is no check neccessary if the ticket has already
been locked by an other user because it has just been
created.
CALL FUNCTION 'ENQUEUE_E_OIJTKT'
EXPORTING
mode_oij_el_ticket_h = 'E'
mandt = sy-mandt
ticket_key = ls_tkt_h-ticket_key
ticket_version = ls_tkt_h-ticket_version
ticket_purpose = ls_tkt_h-ticket_purpose
EXCEPTIONS
foreign_lock = 1
system_failure = 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.
ENDIF.
CALL FUNCTION 'OIJB_GET_NOMINATION_DATA'
EXPORTING
ACTIVITY =
is_ticket_header = ls_tkt_h
is_ticket_item = ls_tkt_i
IV_ADD_TO_LOG =
CHANGING
ct_oijnomh = it_oijnomh
ct_oijnomi = it_oijnomi
RETURN =
EXCEPTIONS
ticket_data_error = 1
no_nomination_selected = 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.
ls_ticket_header = ls_tkt_h.
LOOP AT it_tkt_i INTO ls_tkt_i.
MOVE-CORRESPONDING ls_tkt_i TO ls_ticket_item.
APPEND ls_ticket_item TO it_ticket_item.
ENDLOOP.
LOOP AT it_tkt_i_o1 INTO ls_tkt_i_o1.
MOVE-CORRESPONDING ls_tkt_i_o1 TO ls_ticket_item_o1.
APPEND ls_ticket_item_o1 TO it_ticket_item_o1.
ENDLOOP.
LOOP AT it_tkt_i_o2 INTO ls_tkt_i_o2.
MOVE-CORRESPONDING ls_tkt_i_o2 TO ls_ticket_item_o2.
APPEND ls_ticket_item_o2 TO it_ticket_item_o2.
ENDLOOP.
CALL FUNCTION 'OIJB_GENERATE_DOCUMENTS_N'
EXPORTING
i_ticket_header = ls_ticket_header
i_ticket_header_pv = ls_ticket_header_pv
I_CLOSE_SHIPMENT = ' '
TABLES
t_ticket_item = it_ticket_item
t_ticket_item_o1 = it_ticket_item_o1
t_ticket_item_o2 = it_ticket_item_o2
T_TICKET_ITEM_PV =
T_TICKET_ITEM_O1_PV =
T_TICKET_ITEM_O2_PV =
t_oijnomh = it_oijnomh
t_oijnomi = it_oijnomi
T_DOC_FLOW =
T_ERR_LOG =
T_REVERSAL_DOCS =
T_ORIGINAL_DOCS =
T_TICKET_SUBITEM =
EXCEPTIONS
error_during_cip_process = 1
error_during_checks = 2
nomination_lock_error = 3
nomination_read_error = 4
cip_process_read_error = 5
OTHERS = 6
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ELSE.
COMMIT WORK AND WAIT.
ENDIF.
Maybe you are looking for
-
Problem with JPanel sizing!
Hi, Just having a bit of difficulty with the sizing of JPanels. For example, if I create a JPanel and add it to a Frame, no matter what I set the size to the JPanel fills the entire Frame. I don't really know whats going on here and I'm just making g
-
Document appearing in the billing due list
Hi all, I have got a Periodic billing document order which was raised in 1999 and the last Invoice for the same was raised in 2007 and all the accounting documents have been cleared. There are no pending documents which can be seen in the Document fl
-
What graphic card for a 845 pro
hi can anyone help me please. i have bought a 845 pro mainboard and i was wondering what would be the best graphics card to fit . thanks
-
Is there a listing of all Auth.Objects for SAP and the discription for them
I would like to know if there is a listing of all the Auth.Objects for SAP out there somewhere?? Thank you, Robert
-
Unable to Active the Transformations..?
Hi All I'm Unable to Activate the Transformations.,Rule (target field: ZPRC): No source unit assigned can u solve Thanks in adv