KB61 BDC load
I've created a program which utilises BDC to perform a data load using transaction KB61.
The question is - How do I perform a page down within the BDC ??
I've used transaction SM35 to record the KB61 transaction, and I get a BDC_OKCODE of /00 stored when I scroll down the item page.
But when I incorporate this value into my program, it doesn't perform the page down.
Any ideas ???
Hi Aniruddha,
I am trying to post kb61 with the BAPI you have mentioned. But it is posting kb11 and not kb61. I am getting this warning in return table "Transfer prices are active. Use reposting for line items."
I am passing the following in header
CO_AREA COGB
DOCDATE 27.08.2013
POSTGDATE 27.08.2013
DOC_HDR_TX TEST
TRANS_CURR GBP
and in item table
SEND_CCTR 10029970
COST_ELEM 519992
VALUE_TCUR 200.0600
QUANTITY 0.000
REC_ORDER PP1000000008
Similar Messages
-
Hello friends,
In real time regarding BDC ...How to upload the data is it thru DATASET (i.e., thru Application server)
or thru gui_upload(i.e., thru presentation Server)
No need to give code just gimme in real time what hey will do to upload.
With Regards,
Satyahi satya,
I n BDC we upload data only through GUI_upload when the data has to uploaded from presentation server.
We use dataset statement when we use data from application server.
So, the use of dataset statement comes when we want to run the BDC program in backgroung mode. in background mode the program cannot access the presentation server. So any upload Fm wont work.
So what we do is we load the data in to application server, and instead of using gui_upload to put data from file to internal table, we use dataset statement to read the file from application server and put data into internal table, rest of the functioning remains same.
Hope this helps, Do reward. -
BDC-PROBLEM IN CURRENCY FIELD LOAD
Hi,
This is my BDC CODE to CAll tansaction F-39..
REPORT YSA.
DATA C_F39 LIKE TSTC-TCODE VALUE 'F-39'.
DATA: T_BDCDATA TYPE STANDARD TABLE OF BDCDATA WITH HEADER LINE.
DATA: h_bdcdata TYPE STANDARD TABLE OF BDCDATA WITH HEADER LINE.
DATA C_VAR(25) TYPE C .
DATA G_ASSIGN(19) TYPE X.
DATA : BEGIN OF ITAB OCCURS 0,
ZBETRG LIKE RF05A-SUZAL,
ZVBEL2 LIKE BSEG-VBEL2,
END OF ITAB.
DATA : BEGIN OF ITAB2 OCCURS 0,
ZBETRG(19) TYPE C ,
ZVBEL2 LIKE BSEG-VBEL2,
END OF ITAB2.
DATA COUNT(2) TYPE C.
select Z_PAY_AMT Z_VBELN into ITAB from ZWCSM_PAYMENTS where Z_CUSTOMER
= '0000116153' and Z_PREPAY = 'X' .
APPEND ITAB.
endselect.
*CLEAR SU.
*Loop at zvalue.
su = SU + zvalue-zamt .
*endloop.
CLEAR ITAB2.
LOOP AT ITAB.
MOVE-corresponding ITAB TO ITAB2.
APPEND ITAB2.
ENDLOOP.
perform bdc_dynpro using 'SAPMF05A' '0115'.
perform bdc_field using 'BDC_CURSOR' 'RF05A-NEWKO'.
perform bdc_field using 'BDC_OKCODE' '/00'.
perform bdc_field using 'BKPF-BLDAT' '30.06.2006'.
perform bdc_field using 'BKPF-BLART' 'DA'.
perform bdc_field using 'BKPF-BUKRS' 'US10'.
perform bdc_field using 'BKPF-BUDAT' '05.07.2006'.
perform bdc_field using 'BKPF-MONAT' '7'.
perform bdc_field using 'BKPF-WAERS' 'USD'.
perform bdc_field using 'RF05A-NEWKO' '116153'.
perform bdc_field using 'BSEG-REBZG' ' '.
perform bdc_dynpro using 'SAPMF05A' '1703'.
*perform bdc_field using 'BDC_CURSOR' 'RF05A-BETRG'.
*perform bdc_field using 'BDC_OKCODE' 'RW'.
*perform bdc_field using 'RF05A-ABPOS' '1'.
*CLEAR ITAB.
*REFRESH ITAB.
*ITAB-ZBETRG = '0,11'.
*ITAB-zvbel2 = '0000001458'.
*APPEND itab.
*ITAB-ZBETRG = '38'.
*ITAB-zvbel2 = '0000001459'.
*APPEND itab.
*DELETE ADJACENT DUPLICATES FROM ITAB.
LOOP AT ITAB . "WHERE zvbel2 = '0000001459'.
COUNT = COUNT + 1.
IF itab-zvbel2 = '0000001467'.
*G_ASSIGN = ITAB-ZBETRG.
CONCATENATE 'RF05A-BETRG(' COUNT ')' INTO C_VAR.
CONDENSE C_VAR.
perform bdc_field using C_VAR
ITAB-ZBETRG.
ENDIF.
ENDLOOP.
perform bdc_dynpro using 'SAPMF05A' '1703'.
perform bdc_field using 'BDC_CURSOR' 'RF05A-BETRG'.
perform bdc_field using 'BDC_OKCODE' '=BU'.
perform bdc_field using 'RF05A-ABPOS' '1'.
CALL TRANSACTION C_f39 USING t_bdcdata.
FORM bdc_dynpro USING program dynpro.
CLEAR h_bdcdata.
h_bdcdata-program = program.
h_bdcdata-dynpro = dynpro.
h_bdcdata-dynbegin = 'X'.
APPEND h_bdcdata TO t_bdcdata.
ENDFORM. "BDC_DYNPRO
FORM bdc_field USING fnam fval.
CLEAR h_bdcdata.
h_bdcdata-fnam = fnam.
write fval to h_bdcdata-fval.
h_bdcdata-fval = fval.
APPEND h_bdcdata TO t_bdcdata.
ENDFORM. "BDC_FIELD
Whenever i run this transaction intial screen in filled values correctly, in the continuous when i press enter goes to next screen, in this screen i am getting error as
"FIELD RF05A-BETRG(2) input value is longer than screen field"...
How can i solve this error???
Help needed.....
Thanks,Hi,
DATA bdc_qty(10) TYPE C.
LOOP AT ITAB . "WHERE zvbel2 = '0000001459'.
COUNT = COUNT + 1.
IF itab-zvbel2 = '0000001467'.
bdc_qty = ITAB-ZBETRG.
*translate G_ASSIGN using '.'.
*translate G_ASSIGN using ','.
*condense G_ASSIGN no-gaps.
CONCATENATE 'RF05A-BETRG(' COUNT ')' INTO C_VAR.
CONDENSE C_VAR.
perform bdc_field using 'BDC_CURSOR' C_VAR.
perform bdc_field using C_VAR
bdc_qty.
ENDIF.
ENDLOOP.
Still getting error as "Enter a numberic value" while run BDC load in Second screen of trnasaction F-39????????????? -
IM52-Load Order Budget Upload Program
Hi All,
I'm Working on IM52-Load order budget Change BDC Load Program.i'm using Call Transaction for it.
here i'm getting a problem while recording(With SHDB) the tcode IM52, It showing the error like 'no measure found'.
But the same error i'm not getting while creating manually(i.e., With out SHDB).
So i developed the program by own using technical information, instead of recording in SHDB .
and i ran the program, but i'm getting the same error "No measures Found"
can any one tell me how to develope the BDC program for IM52-Load order budgets change.
should i follow in different way instead of normal BDC programm?
Thanks in advance
RameshHi Caforio Claudio,
Pls check if you have (If the Investment Measure is Internal Order)
You performed the commitment carryforward for measures belonging to the investment program - KOCF
You performed the budget carryforward for measures belonging to the investment program - KOCO
which are pre-requisites for Budget Carryforward for Investment Programs...
Pls check and revert back...
Srikanth Munnaluri -
Turning the concurrent Employment On
Dear all,
Please explain how would the sap system be affected if we turn on the concurrent employment on. What effect does it have on our reports interfaces and BDC load programs. Reports and Interfaces are using PNP logical database right now.
Please explain in detail, any help will be much appreciated.Yes the two pernrs belong to the same employee. Minimum set up on the infotypes you have mentioned has been performed. We are attempting to create the first step in the prepare for global assignment, which means setting up the assignment (copying infotypes from the original assignment). We can not get beyond the first IT0002 in the creation of the 2nd dialog, we never get to any IT's that are required for the concurrent employment infotypes.
Thanks
Amina -
BDC F-03 (page down loading problem)
Sir,
I'm trying BDC for tcode ( clear G/L account.). With following code ..but I'm getting error
on screen number 0731 while page down loading. Please help me ...
REPORT CLEAR_ITEM.
TABLES :BKPF,RF05A.
DATA : BEGIN OF RECORD OCCURS 0,
index(001),
AGKON(16),
BUDAT(10),
MONAT(2),
BUKRS(4),
WAERS(3),
END OF RECORD.
DATA : BEGIN OF RECORD1 OCCURS 0,
index(002),
SEL01 LIKE RF05A-SEL01,
END OF RECORD1.
data dat like sy-datum.
data ibdc like bdcdata occurs 0 with header line.
dat = sy-datum - 1.
CALL FUNCTION 'UPLOAD'
EXPORTING
* CODEPAGE = ' '
FILENAME = 'C:\'
FILETYPE = 'DAT'
* ITEM = ' '
* FILEMASK_MASK = ' '
* FILEMASK_TEXT = ' '
* FILETYPE_NO_CHANGE = ' '
* FILEMASK_ALL = ' '
* FILETYPE_NO_SHOW = ' '
* LINE_EXIT = ' '
* USER_FORM = ' '
* USER_PROG = ' '
* SILENT = 'S'
* IMPORTING
* FILESIZE =
* CANCEL =
* ACT_FILENAME =
* ACT_FILETYPE =
TABLES
DATA_TAB = RECORD.
* EXCEPTIONS
* CONVERSION_ERROR = 1
* INVALID_TABLE_WIDTH = 2
* INVALID_TYPE = 3
* NO_BATCH = 4
* UNKNOWN_ERROR = 5
* GUI_REFUSE_FILETRANSFER = 6
* OTHERS = 7
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION 'UPLOAD'
EXPORTING
* CODEPAGE = ' '
FILENAME = 'C:\'
FILETYPE = 'DAT'
* ITEM = ' '
* FILEMASK_MASK = ' '
* FILEMASK_TEXT = ' '
* FILETYPE_NO_CHANGE = ' '
* FILEMASK_ALL = ' '
* FILETYPE_NO_SHOW = ' '
* LINE_EXIT = ' '
* USER_FORM = ' '
* USER_PROG = ' '
* SILENT = 'S'
* IMPORTING
* FILESIZE =
* CANCEL =
* ACT_FILENAME =
* ACT_FILETYPE =
TABLES
DATA_TAB = RECORD1.
* EXCEPTIONS
* CONVERSION_ERROR = 1
* INVALID_TABLE_WIDTH = 2
* INVALID_TYPE = 3
* NO_BATCH = 4
* UNKNOWN_ERROR = 5
* GUI_REFUSE_FILETRANSFER = 6
* OTHERS = 7
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.
CALL FUNCTION 'BDC_OPEN_GROUP'
EXPORTING
CLIENT = SY-MANDT
* DEST = FILLER8
GROUP = 'F-03'
HOLDDATE = DAT
KEEP = 'X'
USER = SY-UNAME.
* RECORD = FILLER1
* PROG = SY-CPROG
* IMPORTING
* QID =
* EXCEPTIONS
* CLIENT_INVALID = 1
* DESTINATION_INVALID = 2
* GROUP_INVALID = 3
* GROUP_IS_LOCKED = 4
* HOLDDATE_INVALID = 5
* INTERNAL_ERROR = 6
* QUEUE_ERROR = 7
* RUNNING = 8
* SYSTEM_LOCK_ERROR = 9
* USER_INVALID = 10
* OTHERS = 11
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
loop at record.
perform mapping.
CALL FUNCTION 'BDC_INSERT'
EXPORTING
TCODE = 'F-03'
* POST_LOCAL = NOVBLOCAL
* PRINTING = NOPRINT
* SIMUBATCH = ' '
* CTUPARAMS = ' '
TABLES
DYNPROTAB = IBDC.
* EXCEPTIONS
* INTERNAL_ERROR = 1
* NOT_OPEN = 2
* QUEUE_ERROR = 3
* TCODE_INVALID = 4
* PRINTING_INVALID = 5
* POSTING_INVALID = 6
* OTHERS = 7
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
REFRESH IBDC.
ENDLOOP.
CALL FUNCTION 'BDC_CLOSE_GROUP'
* EXCEPTIONS
* NOT_OPEN = 1
* QUEUE_ERROR = 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.
form mapping.
perform bdc_dynpro using 'SAPMF05A' '0131'.
perform bdc_field using 'BDC_CURSOR'
'RF05A-XPOS1(03)'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'RF05A-AGKON'
RECORD-AGKON.
perform bdc_field using 'BKPF-BUDAT'
RECORD-BUDAT.
perform bdc_field using 'BKPF-MONAT'
RECORD-MONAT.
perform bdc_field using 'BKPF-BUKRS'
RECORD-BUKRS.
perform bdc_field using 'BKPF-WAERS'
RECORD-WAERS.
perform bdc_field using 'RF05A-XPOS1(01)'
perform bdc_field using 'RF05A-XPOS1(03)'
'X'.
perform bdc_dynpro using 'SAPMF05A' '0731'.
perform bdc_field using 'BDC_CURSOR'
'RF05A-SEL01(02)'.
perform bdc_field using 'BDC_OKCODE'
'=PA'.
data : A(20) type c,
IDX(2) TYPE C.
ADD 1 TO IDX.
LOOP AT RECORD1 WHERE INDEX = RECORD-index.
IF IDX > 10 .
perform bdc_dynpro using 'SAPMF05A' '0731'.
perform bdc_field using 'BDC_CURSOR'
'RF05A-SEL01(02)'.
perform bdc_field using 'BDC_OKCODE'
'=P+'.
IDX = 1.
ENDIF.
CONCATENATE 'RF05A-SEL01(' IDX ')' INTO A.
ibdc-fnam = A .
IBDC-fval = RECORD1-SEL01.
append ibdc.
CLEAR IBDC.
CLEAR A.
IDX = IDX + 1.
ENDLOOP.
perform bdc_dynpro using 'SAPDF05X' '3100'.
perform bdc_field using 'BDC_OKCODE'
'=BS'.
perform bdc_field using 'BDC_CURSOR'
'RF05A-ABPOS'.
perform bdc_field using 'RF05A-ABPOS'
'1'.
perform bdc_dynpro using 'SAPMF05A' '0700'.
perform bdc_field using 'BDC_CURSOR'
'RF05A-NEWBS'.
perform bdc_field using 'BDC_OKCODE'
'=BU'.
endform.
*& Form bdc_dynpro
* text
* -->P_0137 text
* -->P_0138 text
FORM bdc_dynpro using program type string screen type string.
ibdc-program = program.
ibdc-dynpro = screen.
ibdc-dynbegin = 'X'.
append ibdc.
clear ibdc.
ENDFORM. " bdc_dynpro
*& Form bdc_field
* text
* -->P_0142 text
* -->P_0143 text
FORM bdc_field USING fname type string fvale.
ibdc-fnam = fname.
ibdc-fval = fvale.
append ibdc.
clear ibdc.
ENDFORM. " bdc_field
Thanking you..
Manoj.Ramesh ,
I'll advise you, not to use a bdc-programm for ta's like fb50 - What woud you do, when SAP in future changes the table control to an alv grid control ??
So i advise you , to use Bapis or the standard interface
<b>RFBIBL00</b> to post fi-documents.
Andreas -
Delete the data that is Loaded using BDC
Hi All,
We had loaded the data in SAP using BDC-Session Unfortunately.
Now we want to delete all the data which is loaded usong these sessions.
Please can anyone know the procedure to do so.(May be using LSMW)
It would be really great help.
Thank you,
Moderator message - Moved to the correct forum
Edited by: Rob Burbank on Sep 16, 2009 3:31 PMcan you tell me how you deleted the data using LSMW? I'm trying to use LSMW to delete contents of telephone and fax fields in Vendor Master, using batch recording. I've tried it two ways; loading "blank" phone/fax values from text file, and just setting a a rule of constant (of null) for the telephone/fax field in the mapping step and leaving it out of the upload file. The import and convert steps look fine and display the fields as blank but the field contents are not cleared after I run batch. I used these same objects to load phone number values to these fields with no problem so I know there are no errors in mapping, etc. Is there a trick to deleting fields using LSMW processing steps to clear fields in vendor master?
-
How to revert the data that is loaded using BDC for transaction PA30
Hi All,
We had loaded the data in SAP using BDC-Session Unfortunately.
Now we want to delete all the data which is loaded usong these sessions.
Please can anyone know the procedure to do so.(May be using LSMW)
This is the test environment.
This is the HR Data.
Transaction we used is PA30.
Thank you,
Edited by: Kumar B on Sep 16, 2009 6:55 PMSorry All for the late response.
Thanks Swathi ..I thought in same manner.
But we used the LSMW,It deleted the records in the exact fashion we need.
It was a nice experience.
Use T-code SE38 run the report RPUDELPN and pass the pernr entire data will delete. as it is a test client then go to NUMKR Feature reset it and upload the correct data again.
I think that would not have worked for us as it deletes all the employee records.
Might be dangerous too
If it is has standard fast entry screen then use pa70 for mass deletion
Apart from deletion,Also we need to delimit the previous record.
Thank you All -
I want to load BOM through bdc how?
Hi i want to load BOm through bdc wht fields i can fill and plx help in screen flow while recording in shdb
Goto SHDB an dto recording with the help of your Function team. They will tell you which fields they want to fill and what.
-
Down load the data through BDC
Hi ,
I need to know how to down load the data through BDC , pls suggest me how we can do through data download through only BDC u2013 with datas-- Act group, Sales area ,customer pricing procedure ,shipping condition of customer master.
If you need ant further information pls let me know
Regards
Shivashttp://help.sap.com/saphelp_47x200/helpdata/en/67/42fcccf61011d1bcf9080009b4534c/frameset.htm
http://www.sapunleashed.co.uk/bdc/bdc_recording.htm
http://myweb.dal.ca/hchinni/sap/bdc_home.htm
https://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/bdc&
http://www.sap-img.com/abap/learning-bdc-programming.htm
http://www.sapdevelopment.co.uk/bdc/bdchome.htm
http://www.sap-img.com/abap/difference-between-batch-input-and-call-transaction-in-bdc.htm
http://help.sap.com/saphelp_47x200/helpdata/en/69/c250684ba111d189750000e8322d00/frameset.htm
http://www.sapbrain.com/TUTORIALS/TECHNICAL/BDC_tutorial.html
http://www.sap-img.com/abap/difference-between-batch-input-and-call-transaction-in-bdc.htm
http://www.sap-img.com/abap/question-about-bdc-program.htm
http://www.itcserver.com/blog/2006/06/30/batch-input-vs-call-transaction/
http://www.planetsap.com/bdc_main_page.htm
call Transaction or session method ?
http://myweb.dal.ca/hchinni/sap/bdc_home.htm
https://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/bdc&
http://www.sap-img.com/abap/learning-bdc-programming.htm
http://www.sapdevelopment.co.uk/bdc/bdchome.htm
http://www.sap-img.com/abap/difference-between-batch-input-and-call-transaction-in-bdc.htm
http://help.sap.com/saphelp_47x200/helpdata/en/69/c250684ba111d189750000e8322d00/frameset.htm
http://www.sapbrain.com/TUTORIALS/TECHNICAL/BDC_tutorial.html
http://www.sap-img.com/abap/difference-between-batch-input-and-call-transaction-in-bdc.htm
http://www.sap-img.com/abap/question-about-bdc-program.htm
http://www.itcserver.com/blog/2006/06/30/batch-input-vs-call-transaction/
http://www.planetsap.com/bdc_main_page.htm -
How we load Bom through bdc pgm
Hi I want to load BOM through BDC pgm in wich i am unbale to record the screect flow b coz it asking abt materical not matiching so can u plz send me the navigation screen flow and exple of fields in with i can enter in BOM throus cs01 transaction ... this is very urgent.. Thanking U
Hi
See the Below sample Program ....
Program Loads the Bill of Material
*& REPORT ZPP0120 *
*& Module : PP |
*& Application : The program loads the Bill of Material |
*& |
*| Modification Log |
*| ---------------- |
REPORT zpp0120 NO STANDARD PAGE HEADING
MESSAGE-ID z0
LINE-SIZE 132
LINE-COUNT 65(2).
* Internal Tables *
*Internal table for the BOM file.
DATA: BEGIN OF i_bom OCCURS 0,
matnr(18),
werks(4),
stlan(1),
stlal(2),
stktx(40),
bmeng(16),
menge(16),
posnr(4),
postp(1),
meins(3),
datuv(10),
fmeng(1),
idnrk(18),
potx1(40),
ausch(7),
END OF i_bom.
* Extracting Document and Doc type for POSTP = D.
DATA : BEGIN OF i_stpo OCCURS 1,
doknr(25),
dokar(3),
posnr(4),
stlnr LIKE mast-stlnr,
END OF i_stpo.
* Local work area
DATA: g_my_rec_in LIKE i_bom.
** Declare internal table for Call Transaction and BDC Session
DATA: i_bdc_table LIKE bdcdata OCCURS 0 WITH HEADER LINE.
* Global Variables *
DATA: g_counter(2) TYPE n,
g_field_name(18) TYPE c,
zc_yes TYPE syftype VALUE 'X'.
* Selection Screen *
SELECTION-SCREEN BEGIN OF BLOCK a WITH FRAME TITLE text-001.
PARAMETERS: p_fname1 TYPE localfile .
SELECTION-SCREEN SKIP 1.
SELECTION-SCREEN BEGIN OF BLOCK b WITH FRAME TITLE text-002.
PARAMETERS: p_rloc1 AS CHECKBOX DEFAULT 'X'.
SELECTION-SCREEN BEGIN OF BLOCK c WITH FRAME TITLE text-005.
PARAMETERS p_group(12) OBLIGATORY DEFAULT 'ZBOM'.
SELECTION-SCREEN END OF BLOCK c.
SELECTION-SCREEN END OF BLOCK b.
SELECTION-SCREEN END OF BLOCK a.
**WRITE the report header
TOP-OF-PAGE.
INCLUDE zheading.
* Start of selection *
START-OF-SELECTION.
* Load Input file
PERFORM f_load_input_file.
* Create BDC records.
PERFORM create_bdc_records .
*& Form Create_BDC_records
* text:* perform the BDC for the records in the internal table
* --> p1 text
* <-- p2 text
FORM create_bdc_records .
DATA: v_stlnr LIKE mast-stlnr.
DATA: v_postp(1) VALUE 'D'.
IF NOT i_bom[] IS INITIAL.
** Open BDC session
PERFORM open_bdc_session.
SORT i_bom BY matnr werks posnr.
SELECT SINGLE stlnr INTO v_stlnr
FROM mast
WHERE matnr = i_bom-matnr
AND werks = i_bom-werks.
SELECT doknr dokar posnr stlnr
INTO TABLE i_stpo
FROM stpo
FOR ALL ENTRIES IN i_bom
WHERE postp = v_postp
AND posnr = i_bom-posnr
AND stlnr = v_stlnr.
SORT i_stpo BY posnr stlnr.
LOOP AT i_bom.
g_my_rec_in = i_bom.
READ TABLE i_stpo WITH KEY posnr = i_bom-posnr
stlnr = v_stlnr
BINARY SEARCH.
AT NEW matnr.
CLEAR i_bdc_table[].
PERFORM insert_screen_header.
ENDAT.
* Setting up counter for 20 line items
IF g_counter = 20.
g_counter = 1.
ENDIF.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
*next screen
PERFORM bdc_dynpro USING 'SAPLCSDI' '0140'.
PERFORM bdc_field USING 'BDC_CURSOR' 'RC29P-FMENG(01)'.
PERFORM bdc_field USING 'BDC_OKCODE' '/00'.
CONCATENATE 'RC29P-POSNR(' g_counter ')' INTO g_field_name.
PERFORM bdc_field USING g_field_name i_bom-posnr.
CONCATENATE 'RC29P-IDNRK(' g_counter ')' INTO g_field_name.
PERFORM bdc_field USING g_field_name i_bom-idnrk.
CONCATENATE 'RC29P-MENGE(' g_counter ')' INTO g_field_name.
PERFORM bdc_field USING g_field_name i_bom-menge.
CONCATENATE 'RC29P-MEINS(' g_counter ')' INTO g_field_name.
PERFORM bdc_field USING g_field_name i_bom-meins.
CONCATENATE 'RC29P-POSTP(' g_counter ')' INTO g_field_name.
PERFORM bdc_field USING g_field_name i_bom-postp.
CONCATENATE 'RC29P-FMENG(' g_counter ')' INTO g_field_name.
PERFORM bdc_field USING g_field_name i_bom-fmeng.
*next screen
PERFORM bdc_dynpro USING 'SAPLCSDI' '0130'.
PERFORM bdc_field USING 'BDC_OKCODE' '/00'.
* Check the Item category to direct the screen flow accordingly.
CASE i_bom-postp.
WHEN 'B'.
PERFORM item_text_insert.
WHEN 'Z'.
PERFORM item_text_insert.
WHEN 'T'.
PERFORM item_text_insert.
WHEN 'N'.
PERFORM bdc_field USING 'BDC_CURSOR' 'RC29P-AUSCH'.
PERFORM bdc_field USING 'RC29P-AUSCH' i_bom-ausch.
* next screen
PERFORM item_text_insert.
*next screen
PERFORM bdc_dynpro USING 'SAPLCSDI' '0133'.
PERFORM bdc_field USING 'BDC_OKCODE' '/00'.
PERFORM bdc_field USING 'RC29P-EKORG' ' '.
WHEN 'D'.
PERFORM bdc_field USING 'RC29P-DOKNR' i_stpo-doknr.
PERFORM bdc_field USING 'RC29P-DOKAR' i_stpo-dokar.
* next screen
PERFORM item_text_insert.
* When POSTP = X, L.
WHEN OTHERS.
PERFORM bdc_field USING 'BDC_CURSOR' 'RC29P-AUSCH'.
PERFORM bdc_field USING 'RC29P-AUSCH' i_bom-ausch.
* next screen
PERFORM item_text_insert.
ENDCASE.
g_counter = g_counter + 1.
* next screen
PERFORM bdc_dynpro USING 'SAPLCSDI' '0140'.
PERFORM bdc_field USING 'BDC_CURSOR' 'RC29P-POSNR(01)'.
PERFORM bdc_field USING 'BDC_OKCODE' '=FCBU'.
AT END OF matnr.
PERFORM insert_bdc_new.
ENDAT.
ENDLOOP.
CLEAR i_bom[].
PERFORM close_bdc_session.
** Release the BDC sessions created
PERFORM release_bdc.
ENDIF.
ENDFORM. " open_group
*& Form bdc_dynpro_start
* Initialize the screen
* -->P_G_PROGRAM_1
* -->P_G_SCREEN
FORM bdc_dynpro USING p_g_program_1
p_g_screen.
CLEAR i_bdc_table.
i_bdc_table-program = p_g_program_1.
i_bdc_table-dynpro = p_g_screen.
i_bdc_table-dynbegin = 'X'.
APPEND i_bdc_table.
ENDFORM. " bdc_dynpro_start
*& Form bdc_field
* Insert field *
FORM bdc_field USING f_name f_value.
CLEAR i_bdc_table.
i_bdc_table-fnam = f_name.
i_bdc_table-fval = f_value.
APPEND i_bdc_table.
ENDFORM. "bdc_insert_field
*& Form open_bdc_session
* Open the BDC session
FORM open_bdc_session .
** Open BDC session and creat and update condition records
CALL FUNCTION 'BDC_OPEN_GROUP'
EXPORTING
client = sy-mandt
* DEST = FILLER8
group = p_group
* HOLDDATE = FILLER8
keep = 'X'
user = sy-uname
* RECORD = FILLER1
* PROG = SY-CPROG
* IMPORTING
* QID =
EXCEPTIONS
client_invalid = 1
destination_invalid = 2
group_invalid = 3
group_is_locked = 4
holddate_invalid = 5
internal_error = 6
queue_error = 7
running = 8
system_lock_error = 9
user_invalid = 10
OTHERS = 11
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. " create_bdc_session
*& Form insert_screen_header
* Insert the Header data into the screens
FORM insert_screen_header .
g_counter = 1.
PERFORM bdc_dynpro USING 'SAPLCSDI' '0100'.
PERFORM bdc_field USING 'BDC_CURSOR' 'RC29N-STLAL'.
PERFORM bdc_field USING 'BDC_OKCODE' '/00'.
PERFORM bdc_field USING 'RC29N-MATNR' g_my_rec_in-matnr.
PERFORM bdc_field USING 'RC29N-WERKS' g_my_rec_in-werks.
PERFORM bdc_field USING 'RC29N-STLAN' g_my_rec_in-stlan.
PERFORM bdc_field USING 'RC29N-STLAL' g_my_rec_in-stlal.
PERFORM bdc_field USING 'RC29N-DATUV' g_my_rec_in-datuv.
* next screen
PERFORM bdc_dynpro USING 'SAPLCSDI' '0110'.
PERFORM bdc_field USING 'BDC_CURSOR' 'RC29K-BMENG'.
PERFORM bdc_field USING 'BDC_OKCODE' '/00'.
PERFORM bdc_field USING 'RC29K-STKTX' g_my_rec_in-stktx.
PERFORM bdc_field USING 'RC29K-BMENG' g_my_rec_in-bmeng.
*next screen
PERFORM bdc_dynpro USING 'SAPLCSDI' '0111'.
PERFORM bdc_field USING 'BDC_CURSOR' 'RC29K-LABOR'.
ENDFORM. " insert_screen_header
*& Form insert_bdc
* Insert the BDC session
FORM insert_bdc_new .
CALL FUNCTION 'BDC_INSERT'
EXPORTING
tcode = 'CS01'
* POST_LOCAL = NOVBLOCAL
* PRINTING = NOPRINT
* SIMUBATCH = ' '
* CTUPARAMS = ' '
TABLES
dynprotab = i_bdc_table
EXCEPTIONS
internal_error = 1
not_open = 2
queue_error = 3
tcode_invalid = 4
printing_invalid = 5
posting_invalid = 6
OTHERS = 7
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
CLEAR i_bdc_table[].
ENDFORM. " insert_bdc
*& Form close_bdc_session
* Close the BDC session
FORM close_bdc_session .
CALL FUNCTION 'BDC_CLOSE_GROUP'
EXCEPTIONS
not_open = 1
queue_error = 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.
ENDFORM. " close_bdc_session
*& Form f_load_input_file
* Load the file into the Internal table
FORM f_load_input_file.
IF p_rloc1 = zc_yes.
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
filename = p_fname1
filetype = 'DAT'
TABLES
data_tab = i_bom
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.
STOP.
ENDIF.
ENDIF.
ENDFORM. " f_load_input_file
*& Form release_bdc
* Release BDC session
FORM release_bdc.
SUBMIT rsbdcsub WITH mappe EQ p_group
WITH von EQ sy-datum
WITH bis EQ sy-datum
WITH fehler EQ '.'
EXPORTING LIST TO MEMORY
AND RETURN.
ENDFORM. " release_bdc
*& Form item_text_insert
* Repetitive code in the screen flow
FORM item_text_insert.
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-POTX1' i_bom-potx1.
ENDFORM. " item_text_insert -
How to write bdc programme to load the data in table control
Hi
i have to write a bdc programme and the data to be filled in table control fileds can any one help me with the code how i have to write it is for cs02 tcode
thanks and regards
naveenHi Naveen,
See the sample code
PERFORM bdc_dynpro USING 'SAPLCSDI' '0100'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RC29N-DATUV'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=KALL'.
PERFORM bdc_field USING 'RC29N-MATNR'
w_matnr.
PERFORM bdc_field USING 'RC29N-WERKS'
w_werks.
PERFORM bdc_field USING 'RC29N-STLAN'
'1'.
PERFORM bdc_field USING 'RC29N-DATUV'
'01/01/2004'.
PERFORM bdc_dynpro USING 'SAPLCSDI' '2110'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=FCPU'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RC29K-BMENG'.
PERFORM bdc_field USING 'RC29K-BMENG'
w_testuph.
PERFORM bdc_dynpro USING 'SAPLCSDI' '0150'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RC29P-MENGE(02)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=FCBU'.
PERFORM bdc_field USING 'RC29P-MENGE(01)'
w_testuph.
"For raw material.
IF NOT w_raw_mat_fg IS INITIAL.
PERFORM bdc_field USING 'RC29P-MENGE(02)'
w_testuph.
ENDIF.
PERFORM bdc_dynpro USING 'SAPLCSDI' '0130'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RC29P-POSNR'.
PERFORM bdc_dynpro USING 'SAPLCSDI' '0131'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RC29P-POTX1'.
PERFORM bdc_dynpro USING 'SAPLCSDI' '0130'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RC29P-POSNR'.
PERFORM bdc_dynpro USING 'SAPLCSDI' '0131'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RC29P-POTX1'.
PERFORM bdc_dynpro USING 'SAPLCSDI' '0150'.
CALL TRANSACTION 'CS02' USING bdcdata MODE w_display_mode UPDATE 'S'
MESSAGES INTO t_message_tab.
Prabhudas -
Problem in loading the long text in bdc.
Hai Friends,
I am uploading the material master using bdc, Here i need to upload the long text field. so am using the separate report for upload the long text field using the create_text function module. but the problem is the long text field only accepting 132 charactors. but i need to upload the 500 charactors. what i want to do now ?
Regards ,
Sathis Kumar RHi Sathis,
What u do is that while recording the text part in bdc , click on the first delete button, and then create button and after that double click on the editor or click on the text-editor change button, a window will get opened , then click go-to menu -> change editor.
there u can use loop the text table and wirte it according .
eg
PERFORM bdc_dynpro USING 'SAPMV45A' '4002'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=TP_DELETE'. "first delete
PERFORM bdc_dynpro USING 'SAPMV45A' '4002'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=TP_CREATE'. " then create
PERFORM bdc_field USING 'LV70T-SPRAS'
sy-langu.
PERFORM bdc_dynpro USING 'SAPMV45A' '4002'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=TP_DETAIL'. "if not double click then click on change button after the delete button and then click on the change-editor menu .
PERFORM bdc_field USING 'LV70T-SPRAS'
sy-langu.
PERFORM bdc_dynpro USING 'SAPLSTXX' '1100'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RSTXT-TXLINE(02)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=TXVB'.
PERFORM bdc_field USING 'RSTXT-TXPARGRAPH(02)'
PERFORM bdc_field USING 'RSTXT-TXPARGRAPH(03)'
PERFORM bdc_field USING 'RSTXT-TXLINE(02)'
wa_itab-htext1.
PERFORM bdc_field USING 'RSTXT-TXLINE(03)'
wa_itab-htext2.
PERFORM bdc_dynpro USING 'SAPLSTXX' '1100'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RSTXT-TXLINE(02)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=TXBA'.
PERFORM bdc_dynpro USING 'SAPMV45A' '4002'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/EBACK'.
regards,
Santosh Thorat -
Loading customer master data using lsmw and bdc
Hi all..
Iam a beginner in sap world and my first project is to load the customer master data from mainframes into sap.
Can anyone guide me how to approach to this project and what are the best materials to go through. Also can any one send some sample programs related to these..
It would be a great help of you guys for a beginner like me..
Thanks,
mahiMessage type DEBMAS
Idoc type DEBMAS** where ** is highest number available in your system (check via WE30). e.g. DEBMAS06 -
What is the Tcodes for Uploading of data using BDC & CATT
PP members:
I was going through the <b>cutover activities</b> , and what I understood is we transfer all the legacy system data into SAP before going live
The data upload follows certain steps (depends on the organizational design load strategies)
First we upload all the master data ( material master, BOM, W/C's & Routings)
Then the transaction data ( Ideally speaking, there should no open orders i.e. WIP as on the day of cutoff )
If the WIP (Work in Process) is unavoidable then the materials consumed shall be treated as <b>materials of the previous stage</b> and necessary adjustments shall be made after cutover day
At this point, I could not able to understand what does the author mean <b>materials of the previous stage</b>
Now comming to the uploading of data into SAP from legacy system, we use tools like LSMW, CATT & BDC
Is it a must to use <b>only LSMW tool</b> to upload master data or any other upload tools are fine
Lastly,. I am not sure about the Tcode of CATT & BDC
Summary of the questions:
1.What does the author mean <b>material of previous stage</b>, for WIP materials during cutover activities
2. Is it mandatory to use only LSMW tool for uploading for master data
3. What are the Tcodes for upload tools CATT & BDC ?
Thanks for your time
Suren RDear,
1.What does the author mean material of previous stage, for WIP materials during cutover activities - as i understood, what is the stage of material..like it must have gone through 2 work centers and other 2 is left. i.e. you need to create Production order with only 2 operation as other 2 is already over. - usually it is done in such a way that we will create Production order and confirm till 2 operations and WIp is calculated so thatb FI will tally the books in SAP and lagacy.
2. Is it mandatory to use only LSMW tool for uploading for master data - no you can use any tool as required and suits yr requirement
3. What are the Tcodes for upload tools CATT & BDC- BDC through a prog in SE38. CATT through - SCEM.
Maybe you are looking for
-
Getting error while posting the invoice "Different Local currency "
Hello All, User created Non MRP PO with CNY currency for China and cost center entered which belongs to US country. User posted invoice for this PO and then he understood that cost center which has been entered in the PO was wrong. and he tried to ca
-
Goods Receipt, Good Issue Batch Control
I'm trying to import Goods Receipt and Goods Issue using the DI API for version SAP 6.5 SP1 Patch 17. I was able to import for item that were not batch controlled but not for batch controlled items. I was wondering if anyone had a code sample on how
-
What type of cable??
My screen went out on my g3 and am trying to connect it to a computer monitor (VGA). Apple does not sell cables for the ibook g3 laptop any more. I ordered two cables (mini display port and mini-DVI) and they were either to small or too big for my co
-
Jars in the class path of a custom component
I am using the dom4j-1.6.1.jar library in a custom component, but my JBoss server has dom4j.jar in jboss\server\all\lib. My custom component is throwing the following error: DefFoundError message:org/dom4j/xpath/DefaultXPath while invoking service X
-
PLEASE HELP REGARDING EEWB!!!
after reading few blogs and on reading details on help.sap.com i have understand few things but can sumbody help me on the issue now i facing which may be a bit strange for as i was experimenting with the EEWB. earlier i created few projects with ext