Two transactions in one BDC
Hi Experts......
Could anyone help me how to call two transactions in one BDC Report.I know that it is possible through BDC Session Method. Could you please provide me the procedure...?
Thanks & Regards,
Sai..
Hi,
take all the fields to internal table and then use like this.
Loop at it_table to wa_table.
*************for first Transaction
perform bdc_dynpro using 'SAPMP50A' '1000'.
perform bdc_field using 'BDC_OKCODE'
'=INS'.
perform bdc_transaction using 'TCODE'." first t code
*****************for second transactions
perform bdc_dynpro using 'SAPMP50A' '1000'.
perform bdc_field using 'BDC_OKCODE'
'=INS'.
perform bdc_transaction using 'TCODE'." this t code is second one
endloop.
try this, i hope you can succeed.
Regards,
Arjun.
Edited by: mallikarjuna goud on Dec 17, 2008 10:35 AM
Similar Messages
-
Calling two transaction in one Zprogram
How to call two transaction (MIGO and MIRO)with each transaction should display two different window simultaneously from one Zprogram..
Pls let me know ...Hello Arun
If you like to use an ABAP-OO version here is my approach:
*& Report ZUS_SDN_CALL_TRANSACTION
REPORT zus_sdn_call_transaction.
TYPE-POOLS: abap.
PARAMETERS:
p_tcode TYPE tcode.
START-OF-SELECTION.
CALL FUNCTION 'AUTH_CHECK_TCODE'
EXPORTING
tcode = p_tcode
EXCEPTIONS
parameter_error = 1
transaction_not_found = 2
transaction_locked = 3
transaction_is_menu = 4
menu_via_parameter_transaction = 5
not_authorized = 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 METHOD cl_reca_gui_services=>call_transaction
EXPORTING
id_tcode = p_tcode
* IF_LEAVE_CURRENT = ABAP_FALSE
* IF_SKIP_FIRST_SCREEN = ABAP_FALSE
if_new_external_mode = abap_true " new mode
EXCEPTIONS
error = 1
OTHERS = 2.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
END-OF-SELECTION.
Regards
Uwe -
Two transaction variant do not working for a user
Hi Gurus
I have created two Z t code and made transaction variant through T Code SHD0 and assigned these two ZTcode to a user. now when a user is running the Ztcode screen variant is active on only one. when i assign second one to the user again than screen variant of first ZT code do not work.
can any one tell me why system is doing so.
Regards
ShivHi, I have the same situation. Can you please help how your case got solved ?
Basically I have created two transaction variants- one for XD02, the other for XD03. When I am trying to assign a user to both these transaction variants ( using SET PROPOSAL), only one is getting assigned, other is getting deactivated. Please help. -
Bdc two transactions at a time
Hello frendz,
How do i call two transactions in bdc simultaneously in one bdc program.
Can anyone send me steps or document for the same(to do above process for pb10, pb30, 9005 and 9007).
Pls help me its urgent.
Regards,
AmeetHi ameet,
U can call two Transaction in BDC program by using Call transaction Method But one by one it ll process
like :
1. Fisrt upload ur source file it may be Excel Sheet or Text to ur program (it_data internal table)
2. u r having recorded code (it should be seperate for each transaction)
2. what are all the data required for First transaction u can pass and finish
3. what are all the data required for Second transaction u can pass and finish..thats all
Refer the following code:
here called
1. perform bdc_transaction using 'F-58'
2.perform bdc_transaction using 'FBZ5'.
*& Report ZPAYMENT2 For Payment with printout Data
upload Using BDC.
*& Payment with printout Data upload Using BDC.
*& TCODE: F-58.
*& METHOD: CALL TRANSACTION.
REPORT ZPAYMENT2 no standard page heading line-size 255.
Table Bkpf for Accounting Document Header
Table Bsak for Clear item
Table Bsik for open item
Tables:Bkpf,Bsak,Bsik,t001.
logic for posted
1. User can give either reference no or Acct doc no. REference Doc
takes preceedance
2. If REference no is gvien
* 2.1 Fetch all the records from bkpf table with field
* 'BUKRS' = comp code
* 'XBLNR' = refernce doc no
* 'BLART' = 'RE'(hardcode)
* 2.2 Search for that accounting document(BELNR and GJAHR) for that
Vendor in BSAK (cleared item ) and BSIK (open item)
* 2.2.1 if the document is not there in both tables
* Show error as 'the document doesnt exists'
* 2.2.2 if the document is there in BSAK (cleard item)
* Show error as ' There is no open items for the doc'
* 2.2.3 if ther documet is there in bsik (open item)
* Assign the acct doc no to that record and *process it.
* Note : No Document will not be there in both tables.
3. If Account doc is given
* 3.1 if the document is not there in both tables
* Show error as 'the document doesnt exists'
* 3.2 if the document is there in BSAK (cleard item)
* Show error as ' There is no open items for the doc'
* 3.2 if ther documet is there in bsik (open item)
* Assign the acct doc no to that record and process it.
Note : Document should be posted only when all the line
items are valid
If there is any items with error then the document should not be
posted.
INCLUDE BDC*******************************
include zbdcinclude.
DO NOT CHANGE - the generated data section - DO NOT CHANGE ***
Generated data section with specific formatting - DO NOT CHANGE ***
TYPES: BEGIN OF file_format,
New_doc(2), "1.New document
Comp_code(4), "2.Cmpany code
Pay_method(1), "3.Payment method
Hous_bank(5), "4.Housing bank
Check_lot(4), "5.Check lot
Post_date(10), "6.Posting date
Doc_date(10), "7.Document date
ref_text(15), " Reference Text
doc_htext(25), "8.Document header text
Branch(4), "9.Business area (bank)
Amount1(16), "10.Amount in document currency
Bank_AccTxt(50), "11.Bank account text
Vendor_no(10), "12.Vendor number
Ref_doc(16), "13.Reference document number
Acc_docu(10), "14.Account document number
Partial(2), "15.Partial payment indicator
Pay_Amount(15), "16.Payment amount
Item_text(50), "17.Item text
Bank_no(4), "18.Bank number
End of file_format.
"File format for select the account document number
TYPES: Begin of file_format1,
acc_doc(10), "1.Account document number
fiscal_lay(4), "2.Fiscal layer
cmp_code(4), "3.Company code
Ref_dno(16), "4.Reference document number
doc_type(2), "5.Document type
End of file_format1.
TYPES: Begin of file_format2,
acc_dno(10), "1.Account document number
fiscal_lay(4), "2.Fiscal layer
End of file_format2.
"Work area
TYPES: Begin of file_format3.
include type file_format.
include type file_format2.
TYPES: End of file_format3.
TYPES: Begin of l_opayf1.
include type opayf.
TYPES: End of l_opayf1.
data:l_opayf type l_opayf1.
Constants:
comp_code(4) type c value '5000'.
DATA: IT_Ndoc TYPE STANDARD TABLE OF file_format3,
WA_DATATAB4 TYPE file_format3,
print_opt type OPAYF.
"Work area
DATA: WA_DATATAB1 TYPE file_format1,
WA_DATATAB2 TYPE file_format2,
WA_DATATAB3 TYPE file_format2.
******Internal table generated *****************
DATA: IT_DATA TYPE STANDARD TABLE OF file_format,
WA_DATATAB TYPE file_format,
WA_DATATABH TYPE file_format.
DATA: IT_RAW TYPE TRUXS_T_TEXT_DATA,
NO_OF_LINES TYPE F,
xbelnr type bkpf-belnr.
data:cnt type i value 1,
status(02),
status1(02).
End generated data section ***
START OF SELECTION ************
START-OF-SELECTION.
PERFORM LOAD_FILE_DATA.
PERFORM REPORT_HEADER.
PERFORM PROCESS_DATA.
DESCRIBE TABLE IT_DATA LINES NO_OF_LINES.
READ THE INTERNAL TABLE *
.PERFORM THE BDC.......
*FORM PROCESS_DATA.
LOOP AT it_data into wa_datatab.
LINE_NO = sy-tabix.
add 1 to line_no . "Because header is deleted from excel
IF Wa_datatab-New_doc = 'X'.
IF wa_datatab-New_doc = 'X' and status <> 'X' and
status1 = 'S' and sy-tabix <> 1.
PERFORM PROCESS_BDC.
Status = ''.
Status1 = ''.
Clear it_ndoc.
Refresh it_ndoc.
Clear Wa_datatabH.
Endif.
"Check initial screen entry and some fiels
IF wa_datatab-vendor_no is initial or
wa_datatab-comp_code is initial or
wa_datatab-Pay_method is initial or
wa_datatab-Hous_bank is initial or
wa_datatab-Check_lot is initial or
wa_datatab-Amount1 is initial .
write:/2 line_no,20 'E',25 'Enter initial screen entry first'.
Status = 'X'.
Else.
"Read the header data store in work area
READ TABLE IT_DATA INDEX CNT INTO Wa_datatabH.
perform validate_data1.
ENDIF.
ELSE.
perform validate_data2.
"Allow onely partial partial payment
IF wa_datatab-Partial = 'X' or wa_datatab-Partial = 'x'.
IF Wa_datatab-ref_doc is initial and
wa_datatab-acc_docu is initial.
write:/2 line_no,20 'E',25 'Enter ref_no or acc_no'.
Status = 'X'.
ELSE.
"Select the document number from account heaser table(bkpf)
IF not wa_datatab-ref_doc is initial.
select single belnr gjahr bukrs xblnr blart from bkpf into wa_datatab1
where ( blart = 'RE' or blart = 'KR' )
and
bukrs = comp_code and
xblnr = wa_datatab-ref_doc.
Else.
IF not wa_datatab-acc_docu is initial.
select single belnr gjahr bukrs xblnr blart from bkpf into wa_datatab1
where ( blart = 'RE' or blart = 'KR' )
and
bukrs = comp_code and
belnr = wa_datatab-acc_docu.
ENDIF.
ENDIF.
"Check the document number is exist or not in acc header(bkpf)
IF wa_datatab1-acc_doc is initial.
write:/2 line_no,20 'E',25 'The document doesnot exit',
wa_datatab1-acc_doc.
status = 'X'.
Else.
"Select the document number from clear item table(bsak)
select single belnr gjahr from bsak into wa_datatab2
where lifnr = wa_datatabH-vendor_no and
gjahr = wa_datatab1-fiscal_lay and
belnr = wa_datatab1-acc_doc and
bukrs = comp_code.
"Select the document number from open item table(bsik)
select single belnr gjahr from bsik into wa_datatab3
where lifnr = wa_datatabH-vendor_no and
gjahr = wa_datatab1-fiscal_lay and
belnr = wa_datatab1-acc_doc and
bukrs = comp_code.
"Check the document number is exist or not in both table
IF ( wa_datatab2-acc_dno is initial OR
wa_datatab2-fiscal_lay is initial ) and
( wa_datatab3-fiscal_lay is initial OR
wa_datatab3-acc_dno is initial ).
write:/2 line_no,20 'E',25 'The document doesnot exit',
wa_datatab1-acc_doc.
status = 'X'.
Else.
"Check the document number is exist or not in clear item table(bsak)
IF not wa_datatab2-acc_dno is initial and
not wa_datatab2-fiscal_lay is initial.
write:/2 line_no, 'E',25 'There is no open items for the document',
wa_datatab1-acc_doc.
status = 'X'.
Else.
"Check the document number is exist or not in open item table(bsik)
IF not wa_datatab3-acc_dno is initial and
not wa_datatab3-fiscal_lay is initial.
Status1 = 'S'.
move-corresponding wa_datatab to wa_datatab4.
move-corresponding wa_datatab3 to wa_datatab4.
APPEND wa_datatab4 to IT_NDOC.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
CLEAR wa_datatab.
CLEAR wa_datatab1.
CLEAR wa_datatab2.
CLEAR wa_datatab3.
CLEAR wa_datatab4.
add 1 to cnt.
ENDLOOP.
*ENDFORM.
IF status <> 'X' and status1 = 'S'.
PERFORM PROCESS_BDC.
Endif.
PERFORM WRITE_ERR_FILE.
FORM PROCESS_BDC.
FORM PROCESS_BDC.
DATA:
search_line(2) type n,
search_line1(2) type n,
FIELD_NAME(20) TYPE C,
line_indx(3) type n.
add 1 to line_indx.
perform bdc_dynpro using 'SAPMF05A' '0129'.
perform bdc_field using 'BDC_OKCODE'
'/ENV'.
perform bdc_field using 'BDC_CURSOR'
'BSEG-WRBTR'.
perform bdc_dynpro using 'SAPMF05A' '0130'.
perform bdc_field using 'BDC_CURSOR'
'OPAYF-PSTAP'.
perform bdc_field using 'BDC_OKCODE'
'=MW'.
perform bdc_field using 'OPAYF-BUKRS'
comp_code.
perform bdc_field using 'OPAYF-RZAWE'
wa_datatabH-Pay_method.
perform bdc_field using 'OPAYF-HBKID'
wa_datatabH-Hous_bank.
perform bdc_field using 'OPAYF-PSTAP'
wa_datatabH-Check_lot.
perform bdc_dynpro using 'SAPMF05A' '0129'.
perform bdc_field using 'BDC_CURSOR'
'BKPF-XBLNR'.
perform bdc_field using 'BDC_OKCODE'
'=PA'.
perform bdc_field using 'BKPF-BLDAT'
wa_datatabH-Doc_date.
perform bdc_field using 'BKPF-BUDAT'
wa_datatabH-Post_date.
perform bdc_field using 'BKPF-XBLNR'
wa_datatabH-ref_text.
perform bdc_field using 'BKPF-BKTXT'
wa_datatabH-doc_htext.
perform bdc_field using 'BSEG-WRBTR'
wa_datatabH-Amount1.
perform bdc_field using 'BSEG-GSBER'
Wa_datatabH-Branch.
perform bdc_field using 'BSEG-SGTXT'
wa_datatabH-Bank_AccTxt.
perform bdc_field using 'OPAYF-LIFNR'
wa_datatabH-vendor_no.
perform bdc_field using 'RF05A-XPOS1(01)'
record-XPOS1_01_012.
perform bdc_field using 'RF05A-XPOS1(03)'
'X'.
perform bdc_dynpro using 'SAPMF05A' '0730'.
perform bdc_field using 'BDC_CURSOR'
'RF05A-VONWT(01)'.
perform bdc_field using 'BDC_OKCODE'
'=SL2'.
perform bdc_dynpro using 'SAPMF05A' '0608'.
perform bdc_field using 'BDC_CURSOR'
'RF05A-XPOS1(04)'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_field using 'RF05A-XPOS1(01)'
record-XPOS1_01_010.
perform bdc_field using 'RF05A-XPOS1(04)'
'X'.
Enter item document number in search screen
perform bdc_dynpro using 'SAPMF05A' '0731'.
perform bdc_field using 'BDC_CURSOR'
'RF05A-SEL01(01)'.
Loop at IT_NDOC into wa_datatab4.
add 1 to search_line.
CONCATENATE 'RF05A-SEL01(' search_line ')' INTO FIELD_NAME.
perform bdc_field using FIELD_NAME
wa_datatab4-acc_dno.
if search_line = 10. "if items are more than 10
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_dynpro using 'SAPMF05A' '0731'.
perform bdc_field using 'BDC_CURSOR'
'RF05A-SEL01(01)'.
search_line = 0.
endif.
Endloop.
perform bdc_field using 'BDC_OKCODE'
'=PA'.
Enter the amount of partial payments
perform bdc_dynpro using 'SAPDF05X' '3100'.
perform bdc_field using 'BDC_OKCODE'
'=PART'.
search_line = 1.
Loop at IT_NDOC into wa_datatab4
where Partial = 'X' or Partial = 'x'.
search_line = sy-tabix.
"select the item as first item
perform bdc_dynpro using 'SAPDF05X' '3100'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'RF05A-ABPOS'
search_line.
perform bdc_dynpro using 'SAPDF05X' '3100'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'DF05B-PSZAH(01)'
wa_datatab4-Pay_Amount.
Endloop.
Simulate the all
perform bdc_dynpro using 'SAPDF05X' '3100'.
perform bdc_field using 'BDC_OKCODE'
'=BS'.
perform bdc_field using 'BDC_CURSOR'
'DF05B-PSZAH(01)'.
Give the line number and Item text
Loop at IT_NDOC into wa_datatab4.
add 1 to line_indx.
Click the detial icon
perform bdc_dynpro using 'SAPMF05A' '0700'.
perform bdc_field using 'BDC_CURSOR'
'RF05A-NEWBS'.
perform bdc_field using 'BDC_OKCODE'
'=PI'.
Chose the line item
perform bdc_dynpro using 'SAPMF05A' '0610'.
perform bdc_field using 'BDC_CURSOR'
'*BSEG-BUZEI'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using '*BSEG-BUZEI'
line_indx.
Enter the text and click document over view (AB)
perform bdc_dynpro using 'SAPMF05A' '0302'.
perform bdc_field using 'BDC_CURSOR'
'BSEG-SGTXT'.
perform bdc_field using 'BDC_OKCODE'
'=AB'.
perform bdc_field using 'BSEG-SGTXT'
wa_datatab4-Item_text.
Endloop.
*Save or post
perform bdc_dynpro using 'SAPMF05A' '0700'.
perform bdc_field using 'BDC_CURSOR'
'RF05A-NEWBS'.
perform bdc_field using 'BDC_OKCODE'
'=BU'.
perform bdc_field using 'BDC_OKCODE'
'=D'.
perform bdc_transaction using 'F-58'.
get parameter id 'BLN' field xbelnr.
inserted by ganesh*******************
perform bdc_dynpro using 'SAPMFCHK' '0750'.
perform bdc_field using 'BDC_CURSOR'
'OPAYF-PSTAP'.
perform bdc_field using 'BDC_OKCODE'
'=DRUK'.
perform bdc_field using 'BKPF-BELNR'
xbelnr.
perform bdc_field using 'OPAYF-BUKRS'
'5000'.
perform bdc_field using 'BKPF-GJAHR'
wa_datatab4-fiscal_lay.
perform bdc_field using 'OPAYF-RZAWE'
wa_datatabH-Pay_method.
perform bdc_field using 'OPAYF-PSTAP'
wa_datatabH-Check_lot.
l_opayf-bukrs = '5000'.
l_opayf-PPRIZ = 'DEFA'.
l_opayf-PPRIA = 'DEFA'.
l_opayf-PSTAP = wa_datatabH-Check_lot.
l_opayf-PSOFO = 'X'.
l_opayf-RZAWE = wa_datatabH-Pay_method.
*CALL FUNCTION 'FORM_PRINT_AFTER_POSTING'
EXPORTING
i_belnr = xbelnr
i_gjahr = wa_datatab4-fiscal_lay
i_opayf = L_OPAYF
I_REPRI =
EXCEPTIONS
ADDR_MISSING = 1
CANCEL = 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.
loop at YT042I.
endloop.
*CLEAR L_OPAYF.
perform bdc_dynpro using 'SAPLF028' '0101'.
perform bdc_field using 'OPAYF-ABPOS'
wa_datatabH-Bank_no.
perform bdc_field using 'BDC_OKCODE'
'=PI'.
perform bdc_dynpro using 'SAPLF028' '0101'.
perform bdc_field using 'BDC_CURSOR'
'T042I-HBKID(01)'.
perform bdc_field using 'BDC_OKCODE'
'=PI'.
perform bdc_dynpro using 'SAPMFCHK' '0750'.
perform bdc_field using 'BDC_OKCODE'
'/n'.
perform bdc_dynpro using 'SAPMFCHK' '0750'.
perform bdc_field using 'BDC_OKCODE'
'/n'.
perform bdc_transaction using 'FBZ5'.
if not xbelnr is initial.
clear allmessages.
allmessages-line_no = line_no.
allmessages-msg_type = 'S'.
concatenate
'Document '
xbelnr
' created successfully.'
into
allmessages-msg_desc.
append allmessages.
perform write_to_screen.
perform print_cheque.
endif.
clear xbelnr.
set parameter id 'BLN' field xbelnr.
ENDFORM.
FORM HEADER_DETAILS *
FORM REPORT_HEADER.
new-line.
uline.
WRITE : AT 10 ' BDC to upload Custemer master data Extending',
70 'Date : ',
80 SY-DATUM.
NEW-LINE.
WRITE : AT 70 'Time : ',
80 SY-UZEIT.
uline.
WRITE : AT 2 ' LINE NO ',
15 'MSG TYPE ',
25 ' DESCRIPTION'.
ULINE.
ENDFORM.
FORM LOAD FILE DATA
FORM LOAD_FILE_DATA.
refresh: IT_DATA,
ALLMESSAGES.
clear: IT_DATA,
ALLMESSAGES.
data: IT_RAW TYPE TRUXS_T_TEXT_DATA.
Load the GL Master File to the Internal table
CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
EXPORTING
I_FIELD_SEPERATOR =
i_line_header = 'X'
i_tab_raw_data = it_raw " WORK TABLE
i_filename = p_file
TABLES
i_tab_converted_data = IT_DATA[] "ACTUAL DATA
EXCEPTIONS
conversion_failed = 1
OTHERS = 2.
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.
ENDFORM.
FORM convert into internal format (unpack)
form convert_internal changing field.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = field
IMPORTING
OUTPUT = field.
endform.
FORM validate data
form validate_data1.
perform convert_internal changing wa_datatabh-vendor_no.
perform convert_internal changing wa_datatabh-COMP_CODE.
endform.
form validate_data2.
perform convert_internal changing wa_datatab-ref_doc.
perform convert_internal changing wa_datatab-Acc_docu.
endform.
FORM WRITE ERROR MESSAGE TO SCREEN
FORM WRITE_TO_SCREEN.
NEW-LINE.
write : AT 2 line_no ,
AT 25 ALLMESSAGES-MSG_DESC.
IF ALLMESSAGES-MSG_TYPE = 'E'.
WRITE: AT 17 ALLMESSAGES-MSG_TYPE COLOR COL_NEGATIVE.
ELSE.
WRITE: AT 17 ALLMESSAGES-MSG_TYPE.
ENDIF.
ENDFORM.
FORM WRITE ERROR MESSAGE TO SCREEN
form print_cheque.
clear print_opt.
print_opt-BUKRS = comp_code.
print_opt-RZAWE = wa_datatabH-Pay_method.
print_opt-HBKID = wa_datatabH-Hous_bank.
print_opt-PSTAP = wa_datatabH-Check_lot.
print_opt-PPRIZ = 'DEFA'. "default printer
print_opt-PPRIA = 'DEFA'. "default printer
print_opt-PSOFO = 'X'. "print imm
print_opt-PESPR = 'X'. "Text in receipient lang
print_opt-LIFNR = wa_datatabH-vendor_no.
select single * from t001 where bukrs = comp_code.
CALL FUNCTION 'GL_ACCOUNT_FOR_PAYMENT'
EXPORTING
I_BUKRS = comp_code
I_HBKID = wa_datatabH-Hous_bank
I_LAND1 = t001-land1
I_WAERS = 'INR'
I_ZLSCH = wa_datatabH-pay_method.
IMPORTING
E_HKONT =
E_HKTID =
CALL FUNCTION 'PAYMENT_FORM_PRINT'
EXPORTING
I_OPAYF = print_opt
I_VBLNR = xbelnr
endform.
Regards,
ganesh -
There are two transactions ZJPVCS303 and ZJPVCS303_US for one single Report
When run as a batch program, (currently this is the case), or withT-Code ZJPVCS303 the selection screen is unchanged (except for additional sales area above)
- When run as T-Code ZJPVCS303_UL (UL stands for Upload) the selection screen is changed. The unix file option is no longer available, and the user is able to upload a local file (in the same format as the current unix file, but tab delimited) to the program for processing.
Requirements:
There are two transactions ZJPVCS303 and ZJPVCS303_US for one single Report.
->When ZJPVCS303 Transaction is executed, the file is uploaded from the Application
server to SAP R/3. The selection screen parameters would be:
Logical Filename:
Sales Organization:
Distribution Channel:
Division:
->When ZJPVCS303_US Transaction is executed, the file is uploaded from the Presentation Server
to SAP R/3. When this transaction is executed, it should not have the 'Logical
Filename' parameter anymore on the selection-screen. Instead it should only have
Local File name on the presentation server:
Sales Organization:
Distribution Channel:
Division:
The same thing is applicable for the other transaction ZJPVCS303. When transaction ZJPVCS303
is executed, it should not have the 'Local Filename' parameter anymore on the selection-screen. Instead it should only have
Logical Filename:
Sales Organization:
Distribution Channel:
Division:
So how should I make these parameters invisible depending on the transaction codes execution.
I have an idea of using MODIF ID, LOOPING AT SCREEN...MODIFY SCREEN.
I have an idea of using SY-TCODE.
EX:
AT SELECTION-SCREEN OUTPUT.
IF SY-TCODE = 'ZJPVCS303'.
LOOP AT SCREEN.
IF SCREEN-GROUPID = 'GRP'.
SCREEN-INPUT = 0.
SCREEN-INVISIBLE = 1.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ELSEIF SY-TCODE = 'ZJPVCS303_US'.
LOOP AT SCREEN.
IF .....
ENDLOOP.
ENDIF.
ENDIF.
But I am not able to get the output which I require. Please help me out.Hello Rani
Basically the transaction determines whether upload starts from application server (AS) or presentation server (PC). Thus, you will have the following parameter:
PARAMETERS:
p_as_fil TYPE filename MODIF ID unx, " e.g. Unix server
p_pc_fil TYPE filename MODIF ID wnd. " e.g. Windows PC
AT SELECTION-SCREEN OUTPUT.
CASE syst-tcode.
* transaction(s) for upload from server (AS)
WHEN 'ZJPVCS303.
LOOP AT screen.
IF ( screen-group1 = 'UNX' ).
screen-input = 0.
screen-invisible = 1.
MODIFY screen.
ENDIF.
ENDLOOP.
* transaction(s) for upload from local PC (PC)
WHEN 'ZJPVCS303_US.
LOOP AT screen.
IF ( screen-group1 = 'WND' ).
screen-input = 0.
screen-invisible = 1.
MODIFY screen.
ENDIF.
ENDLOOP.
WHEN others.
ENDCASE.
Regards
Uwe -
Saving data into two tables "in one transaction"
Hello everybody!
My scenario is the following: SAP PI receives message containing some data (header and MULTIPLE details data in one message) and has to transfere this data to a database.
In the database there are two tables for storing the data contained in the message: one for HEADER data and one for DETAILS data. I need to save all the data (header and MULTIPLE details data) into these two tables "in one transaction" and roll back saving of HEADER data and DETAILS data if saving of some DETAILS data has failed.
I am going to use receiver JDBC adapter for this purpose.
My questions are:
1. How can I save all the data "in one transaction"? Will it work if I transform the source message into the target message which looks something like this?
<root>
<StatementName1>
<dbTableName action=u201CUPDATE_INSERTu201D>
<table>HEADER_table</table>
<access>
<col1>val1</col1>
<col2>val2</col2>
</access>
<key1>
<col1>val1</col1>
</key1>
</dbTableName>
</StatementName1>
<StatementName2>
<dbTableName action=u201CUPDATE_INSERTu201D>
<table>DETAILS_table</table>
<access>
<col1>val1</col1>
<col2>val3</col2>
</access>
<key1>
<col1>val1</col1>
</key1>
</dbTableName>
</StatementName2>
<StatementName3>
<dbTableName action=u201CUPDATE_INSERTu201D>
<table>DETAILS_table</table>
<access>
<col1>val1</col1>
<col2>val4</col2>
</access>
<key1>
<col1>val1</col1>
</key1>
</dbTableName>
</StatementName3>
</root>
2. How to roll back saving of HEADER data in the case of saving of DETAILS data has failed?
3. What will be the response structure returned by database look like in the case of success?
Thanks,
VikaI guess the response in my case will be something as following?
<response>
<Statement1_response>
<row>
<update_count>1</update_count>
<insert_count>0</insert_count>
</row>
</Statement1_response>
<Statement2_response>
<row>
<update_count>0</update_count>
<insert_count>1</insert_count>
</row>
<row>
<update_count>0</update_count>
<insert_count>1</insert_count>
</row>
</Statement2_response>
</response>
Vika -
Can we record two transactions and use for a Call-transaction BDC?
can we record two transactions and upload data using Call-transaction method in BDC ?IF not why?
Hi Prakash,
Here i used two transactions.
REPORT zra_gl_cr NO STANDARD PAGE HEADING LINE-SIZE 255.
TYPE-POOLS: truxs.
DATA: it_raw TYPE truxs_t_text_data.
DATA:messtab1 LIKE bdcmsgcoll OCCURS 0 WITH HEADER LINE.
DATA:messtab LIKE bdcmsgcoll OCCURS 0 WITH HEADER LINE.
DATA: bdcdata LIKE bdcdata OCCURS 0 WITH HEADER LINE.
DATA: BEGIN OF i_mess OCCURS 0,
l_mstring(480),
msgnr(5),
msgv1(15),
END OF i_mess.
DATA:i_mess1 LIKE i_mess OCCURS 0 WITH HEADER LINE.
DATA: l_mstring(480),l_mstring1(480).
DATA: BEGIN OF it_itab OCCURS 0,
saknr(10), "G/L a/c number.
bukrs(4), "Company Code.
ktoks(4), "G/L a/c group.
xplacct(1), "P&L statement account.
xbilk(1), "Balance sheet account.
txt20_ml(20), "G/L a/c short text.
txt50_ml(50), "G/L a/c long text.
waers(5), "Account currency.
MWSKZ(2),
mitkz(1), "Reconciliation a/c for a/c type.
xopvw(1), "Open item management
xkres(1), "Line item display.
zuawa(3), "Sort Key.
fstag(4), "Field status group.
xintb(1), "Post automatically only.
hbkid(5), "House bank.
hktid(5), "Account id.
vzskz(2), "Interest indicator
END OF it_itab.
DATA: hdate LIKE sy-datum.
Selection Screen *****
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 5(15) text-103. " FOR FIELD P_FILE1.
SELECTION-SCREEN POSITION 25.
PARAMETERS : p_file1 LIKE rlgrap-filename.
SELECTION-SCREEN END OF LINE.
Initialization *****
INITIALIZATION.
At Selection Screen *****
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file1.
Perform file_selection will help to select the location of the file
PERFORM file_selection.
Start-Of-Selection *****
START-OF-SELECTION.
Perform data_upload will help to upload the data from the flat file
to the internal table.
PERFORM data_upload.
PERFORM open_group.
Peform bdc_upload will help to upload the data from the internal
table into its respective fields.
PERFORM bdc_fspo.
PERFORM bdc_upload.
PERFORM exp_log.
PERFORM close_group.
Perform display_log will prepare a log for the data that has been
uploaded
PERFORM display_log.
End-Of-Selection ****
END-OF-SELECTION.
*& Form file_selection
To select the location of the file
FORM file_selection .
CALL FUNCTION 'WS_FILENAME_GET'
EXPORTING
def_filename = ' '
def_path = 'C:\'
mask = ',.txt,.xls.'
mode = 'O'
title = 'Open a excel file'
IMPORTING
filename = p_file1
EXCEPTIONS
inv_winsys = 1
no_batch = 2
selection_cancel = 3
selection_error = 4
OTHERS = 5.
ENDFORM. " file_selection
*& Form data_upload
To upload the data from the file location to the internal table.
FORM data_upload .
CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
EXPORTING
I_FIELD_SEPERATOR =
i_line_header = 'X'
i_tab_raw_data = it_raw
i_filename = p_file1
TABLES
i_tab_converted_data = it_itab
EXCEPTIONS
conversion_failed = 1
OTHERS = 2.
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. " data_upload
*& Form bdc_upload
To upload the data from the internal table into its respective fields.
FORM bdc_upload .
LOOP AT it_itab.
perform bdc_dynpro using 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
perform bdc_field using 'BDC_OKCODE'
'=ACC_CRE'.
perform bdc_field using 'BDC_CURSOR'
'GLACCOUNT_SCREEN_KEY-SAKNR'.
perform bdc_field using 'GLACCOUNT_SCREEN_KEY-SAKNR'
it_itab-SAKNR.
perform bdc_field using 'GLACCOUNT_SCREEN_KEY-BUKRS'
it_itab-BUKRS.
perform bdc_dynpro using 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
perform bdc_field using 'BDC_OKCODE'
'=2102_GROUP'.
perform bdc_field using 'BDC_CURSOR'
'GLACCOUNT_SCREEN_COA-KTOKS'.
perform bdc_field using 'GLACCOUNT_SCREEN_COA-KTOKS'
it_itab-KTOKS.
perform bdc_field using 'GLACCOUNT_SCREEN_COA-XPLACCT'
it_itab-XPLACCT.
perform bdc_dynpro using 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
perform bdc_field using 'BDC_OKCODE'
'=2102_BS_PL'.
perform bdc_field using 'BDC_CURSOR'
'GLACCOUNT_SCREEN_COA-XBILK'.
perform bdc_field using 'GLACCOUNT_SCREEN_COA-KTOKS'
it_itab-KTOKS.
perform bdc_field using 'GLACCOUNT_SCREEN_COA-XPLACCT'
it_itab-XPLACCT.
perform bdc_field using 'GLACCOUNT_SCREEN_COA-XBILK'
it_itab-XBILK.
perform bdc_dynpro using 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
perform bdc_field using 'BDC_OKCODE'
'=ENTER'.
perform bdc_field using 'GLACCOUNT_SCREEN_COA-KTOKS'
it_itab-KTOKS.
perform bdc_field using 'GLACCOUNT_SCREEN_COA-XBILK'
it_itab-XBILK.
perform bdc_field using 'GLACCOUNT_SCREEN_COA-TXT20_ML'
it_itab-TXT20_ML.
perform bdc_field using 'GLACCOUNT_SCREEN_COA-TXT50_ML'
it_itab-TXT50_ML.
perform bdc_field using 'BDC_CURSOR'
'GLACCOUNT_SCREEN_COA-BILKT'.
perform bdc_field using 'GLACCOUNT_SCREEN_COA-BILKT'
it_itab-saknr.
PERFORM bdc_dynpro USING 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=TAB02'.
PERFORM bdc_field USING 'BDC_CURSOR'
'GLACCOUNT_SCREEN_COA-KTOKS'.
PERFORM bdc_field USING 'GLACCOUNT_SCREEN_COA-KTOKS'
it_itab-ktoks.
PERFORM bdc_field USING 'GLACCOUNT_SCREEN_COA-TXT20_ML'
it_itab-txt20_ml.
PERFORM bdc_field USING 'GLACCOUNT_SCREEN_COA-TXT50_ML'
it_itab-txt50_ml.
perform bdc_field using 'BDC_CURSOR'
'GLACCOUNT_SCREEN_COA-BILKT'.
perform bdc_field using 'GLACCOUNT_SCREEN_COA-BILKT'
it_itab-saknr.
perform bdc_dynpro using 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
perform bdc_field using 'BDC_OKCODE'
'=TAB02'.
perform bdc_field using 'BDC_CURSOR'
'GLACCOUNT_SCREEN_COA-KTOKS'.
perform bdc_field using 'GLACCOUNT_SCREEN_COA-KTOKS'
it_itab-KTOKS.
perform bdc_field using 'BDC_CURSOR'
'GLACCOUNT_SCREEN_COA-KTOKS'.
perform bdc_field using 'GLACCOUNT_SCREEN_COA-KTOKS'
it_itab-KTOKS.
perform bdc_field using 'GLACCOUNT_SCREEN_COA-XBILK'
it_itab-XBILK.
perform bdc_field using 'GLACCOUNT_SCREEN_COA-TXT20_ML'
it_itab-TXT20_ML.
perform bdc_field using 'GLACCOUNT_SCREEN_COA-TXT50_ML'
it_itab-TXT50_ML.
perform bdc_field using 'GLACCOUNT_SCREEN_COA-BILKT'
it_itab-saknr.
perform bdc_dynpro using 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
perform bdc_field using 'BDC_OKCODE'
'=ENTER'.
perform bdc_field using 'GLACCOUNT_SCREEN_CCODE-WAERS'
it_itab-waers.
perform bdc_field using 'GLACCOUNT_SCREEN_CCODE-MWSKZ'
it_itab-MWSKZ.
perform bdc_field using 'GLACCOUNT_SCREEN_CCODE-MITKZ'
it_itab-mitkz.
perform bdc_field using 'BDC_CURSOR'
'GLACCOUNT_SCREEN_CCODE-XOPVW'.
perform bdc_field using 'GLACCOUNT_SCREEN_CCODE-XOPVW'
it_itab-XOPVW.
perform bdc_field using 'GLACCOUNT_SCREEN_CCODE-XKRES'
it_itab-XKRES.
perform bdc_field using 'GLACCOUNT_SCREEN_CCODE-ZUAWA'
it_itab-ZUAWA.
PERFORM bdc_field USING 'GLACCOUNT_SCREEN_COA-XPLACCT'
it_itab-xplacct.
PERFORM bdc_field USING 'GLACCOUNT_SCREEN_COA-XBILK'
it_itab-xbilk.
IF it_itab-xbilk = 'X'.
PERFORM bdc_dynpro USING 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=TAB03'.
PERFORM bdc_field USING 'BDC_CURSOR'
'GLACCOUNT_SCREEN_CCODE-WAERS'.
PERFORM bdc_field USING 'GLACCOUNT_SCREEN_CCODE-WAERS'
it_itab-waers.
PERFORM bdc_field USING 'GLACCOUNT_SCREEN_CCODE-XOPVW'
it_itab-xopvw.
PERFORM bdc_field USING 'GLACCOUNT_SCREEN_CCODE-MITKZ'
it_itab-mitkz.
ENDIF.
PERFORM bdc_field USING 'GLACCOUNT_SCREEN_CCODE-XKRES'
it_itab-xkres.
PERFORM bdc_field USING 'GLACCOUNT_SCREEN_CCODE-ZUAWA'
it_itab-zuawa.
PERFORM bdc_dynpro USING 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=SAVE'.
PERFORM bdc_field USING 'BDC_CURSOR'
'GLACCOUNT_SCREEN_CCODE-FSTAG'.
PERFORM bdc_field USING 'GLACCOUNT_SCREEN_CCODE-FSTAG'
it_itab-fstag.
PERFORM bdc_field USING 'GLACCOUNT_SCREEN_CCODE-XINTB'
it_itab-xintb.
PERFORM bdc_field USING 'GLACCOUNT_SCREEN_CCODE-HBKID'
it_itab-hbkid.
PERFORM bdc_field USING 'GLACCOUNT_SCREEN_CCODE-HKTID'
it_itab-hktid.
PERFORM bdc_field USING 'GLACCOUNT_SCREEN_CCODE-VZSKZ'
it_itab-vzskz.
perform bdc_dynpro using 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
perform bdc_field using 'BDC_OKCODE'
'=TAB03'.
perform bdc_field using 'BDC_CURSOR'
'GLACCOUNT_SCREEN_CCODE-WAERS'.
perform bdc_field using 'GLACCOUNT_SCREEN_CCODE-WAERS'
it_itab-WAERS.
perform bdc_field using 'GLACCOUNT_SCREEN_CCODE-MWSKZ'
it_itab-MWSKZ.
perform bdc_field using 'GLACCOUNT_SCREEN_CCODE-MITKZ'
it_itab-MITKZ.
perform bdc_field using 'GLACCOUNT_SCREEN_CCODE-ZUAWA'
it_itab-ZUAWA.
perform bdc_dynpro using 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
perform bdc_field using 'BDC_OKCODE'
'=ENTER'.
perform bdc_field using 'BDC_CURSOR'
'GLACCOUNT_SCREEN_CCODE-FSTAG'.
perform bdc_field using 'GLACCOUNT_SCREEN_CCODE-FSTAG'
it_itab-FSTAG.
perform bdc_dynpro using 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
perform bdc_field using 'BDC_OKCODE'
'=SAVE'.
perform bdc_field using 'BDC_CURSOR'
'GLACCOUNT_SCREEN_CCODE-FSTAG'.
perform bdc_field using 'GLACCOUNT_SCREEN_CCODE-FSTAG'
it_itab-FSTAG.
PERFORM bdc_transaction USING 'FS00'.
CALL TRANSACTION 'FS00' USING bdcdata MODE 'A'
UPDATE 'S'
MESSAGES INTO messtab1.
PERFORM mess1.
REFRESH bdcdata[].
ENDLOOP.
ENDFORM. " bdc_upload
*& Form bdc_fspo
text
FORM bdc_fspo .
LOOP AT it_itab.
PERFORM bdc_dynpro USING 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ACC_CRE'.
PERFORM bdc_field USING 'BDC_CURSOR'
'GLACCOUNT_SCREEN_KEY-SAKNR'.
PERFORM bdc_field USING 'GLACCOUNT_SCREEN_KEY-SAKNR'
it_itab-saknr.
PERFORM bdc_field USING 'GLACCOUNT_SCREEN_KEY-KTOPL'
'1000'.
PERFORM bdc_dynpro USING 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=2102_GROUP'.
PERFORM bdc_field USING 'BDC_CURSOR'
'GLACCOUNT_SCREEN_COA-KTOKS'.
PERFORM bdc_field USING 'GLACCOUNT_SCREEN_COA-KTOKS'
it_itab-ktoks.
PERFORM bdc_field USING 'GLACCOUNT_SCREEN_COA-XPLACCT'
it_itab-xplacct.
PERFORM bdc_field USING 'GLACCOUNT_SCREEN_COA-XBILK'
it_itab-xbilk.
PERFORM bdc_dynpro USING 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=SAVE'.
PERFORM bdc_field USING 'GLACCOUNT_SCREEN_COA-KTOKS'
it_itab-ktoks.
PERFORM bdc_field USING 'GLACCOUNT_SCREEN_COA-XPLACCT'
it_itab-xplacct.
PERFORM bdc_field USING 'BDC_CURSOR'
'GLACCOUNT_SCREEN_COA-TXT50_ML'.
PERFORM bdc_field USING 'GLACCOUNT_SCREEN_COA-TXT20_ML'
it_itab-txt20_ml.
PERFORM bdc_field USING 'GLACCOUNT_SCREEN_COA-TXT50_ML'
it_itab-txt50_ml.
*perform bdc_transaction using 'FSP0'.
CALL TRANSACTION 'FSP0' USING bdcdata MODE 'A'
UPDATE 'S'
MESSAGES INTO messtab.
PERFORM mess.
REFRESH bdcdata[].
ENDLOOP.
ENDFORM. " bdc_fspo
*& Form mess
text
--> p1 text
<-- p2 text
FORM mess . "fsp0
LOOP AT messtab.
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
id = messtab-msgid
lang = messtab-msgspra
no = messtab-msgnr
v1 = messtab-msgv1
v2 = messtab-msgv2
v3 = messtab-msgv3
v4 = messtab-msgv4
IMPORTING
msg = l_mstring
EXCEPTIONS
not_found = 1
OTHERS = 2.
CONDENSE l_mstring.
i_mess1-l_mstring = l_mstring(250).
i_mess1-msgnr = messtab1-msgnr.
i_mess1-msgv1 = messtab1-msgv1.
APPEND i_mess1.
ENDLOOP.
ENDFORM. " mess
*& Form mess1
text
--> p1 text
<-- p2 text
FORM mess1 . "fs00
LOOP AT messtab1.
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
id = messtab1-msgid
lang = messtab1-msgspra
no = messtab1-msgnr
v1 = messtab1-msgv1
v2 = messtab1-msgv2
v3 = messtab1-msgv3
v4 = messtab1-msgv4
IMPORTING
msg = l_mstring1
EXCEPTIONS
not_found = 1
OTHERS = 2.
CONDENSE l_mstring1.
i_mess-l_mstring = l_mstring1(250).
i_mess-msgnr = messtab1-msgnr.
i_mess-msgv1 = messtab1-msgv1.
APPEND i_mess.
ENDLOOP.
ENDFORM. " mess1
*& Form exp_log
text
--> p1 text
<-- p2 text
FORM exp_log .
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = 'c:\temp\error_fsp0.txt'
filetype = 'DAT'
TABLES
data_tab = i_mess1.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = 'c:\temp\error_fs00.txt'
filetype = 'DAT'
TABLES
data_tab = i_mess.
ENDFORM. " exp_log
*& Form bdc_dynpro
text
-->PROGRAM text
-->DYNPRO text
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.
CLEAR bdcdata.
bdcdata-fnam = fnam.
bdcdata-fval = fval.
APPEND bdcdata.
ENDFORM. "BDC_Field
********Rewards some points. -
Call two programs from one program.
HI all,
I have two BDC interface in seperate programs.
I want to call that two programs from one program based on a condition.
Is there any way.
I tried with call transaction 'SE38'.
set parameter ID but it is taking buffered value.
Thanks,
sriuse submit program to call other program.
SUBMIT prog|(field) [AND RETURN] [options].
also if you want BDC prog, then probably you can call the BDC recording using PERFORM bdc_prog (in program name).
PERFORM (<fsubr>)[IN PROGRAM (<fprog>)][USING ... <pi>... ]
[CHANGING... <pi>... ]
[IF FOUND].
http://help.sap.com/saphelp_nw2004s/helpdata/en/9f/db9dd035c111d1829f0000e829fbfe/content.htm -
Update Rules in ABAP to consolidate two InfoSources into one ODS?
Hello experts,
I want to solve the following problem with ABAP update rules (I am a novice in ABAP):
In an Oracle DB I have two tables TRANSACTIONS and PARTICIPANTS with an 1:n relationship:
One or many PARTICIPANTS can be assigned to one TRANSACTIONS and
one TRANSACTION can be assigned to one PARTICIPANT.
I want an ODS that contains TRANSACTIONS with the number of male and female PARTICIPANTS of each transaction.
So I created two InfoSources each representing one of the above tables:
IO_TRANSACTION with COMM_STRUCTURE:
TRANS_ID
TRANS_DATE
TRANS_STATE
IO_PARTICIPANT with COMM_STRUCTURE:
PARTIC_ID
PARTIC_TYPE (1=male and 2=female)
TRANS_ID
Now I want to consolidate all male participants into the data field PARTIC_M
and all female participants into the data field PARTIC_F of the following ODS:
Key fields:
TRANS_ID
TRANS_DATE
TRANS_STATE
Data fields:
PARTIC_M (number of male participants)
PARTIC_F (number of female participants)
I tried it with the following lines of ABAB Code in the ABAP routine
for the datafield PARTIC_M:
IF COMM_STRUCTURE-/BIC/PARTIC_TYPE = 1. " 1 is the value for "male"
RESULT = 1.
ELSE.
RESULT = 0.
ENDIF.
But after loading both InfoSources into the ODS the fields PARTIC_M and PARTIC_F are empty!!
Do I have to do some kind of joint in a start routine in order to connect Participant Information with a specific transaction?? How?
Thanks a lot
Of course, solutions will be rewarded
AxelHi Venkat,
Thanks for the hint with the common key fields.
My problem is, that both tables have only the field TRANS_ID in common.
So when I update TRANSACTIONS with the three Key fields TRANS_ID, TRANS_DATE and TRANS_STATE
and PARTICIPANTS with the Key field TRANS_ID into the ODS I get data like this:
TRANS_ID, TRANS_DATE, TRANS_STATE, PARTIC_M, PARTIC_F
TR01 1 1
TR02 0 3
But I also need the fields TRANS_DATE, TRANS_STATE to be filld with data!
any suggestions?
Axel -
Separate transactions in one ADF app?
Hello All!
Is it possible to create two (ore more) separate transactions in one ADF ApplicationModule? I use JDev 10.1.2 and the default stack: ADF BC, Struts and JSP.
I would like to do something similar:
I've got two tables, orders, and partners. Partners may have one or more orders.
1. I create a new order object.
2. I would like to set the order's partner attribute.
3. I navigate to another page to select the partner to populate with it the new order's property.
4. The partner doesn't exist in the table yet, so I create a new one.
5. I want to commit the partner's changes into the DB, and go back to the orders page to continue the orders data entering with the new partner's id populated into new order's data.
6. But if I finally rollback the order's changes I would the partners changes not to lose.
As far as I understand, if I use more ApplicationModule instances, I can do this easily create order instance in one AppMod and the person instance in the another one, and so I can commit or rollback them separately.
Is it possible with one AppModule instance? Or is there any other solution for it?
Thanks a lot in advance!
NSTo my knowledge 1 AM instance = 1 Transaction.
So you'll have to create the Partner in a separate AM and commit the transaction in order to use the new Partner in the other AM instance.
Regards
Fred -
Three transactions in one program
Hi All,
How do I create 3 transactions for one program.
I have created one module pool program for employee details CREATION and I have one transaction for that.
Now I want to create Two more transaction for two functionalities DISPLAY and CHANGE.
Please tell me, how to implement this.
Thanks & Regards,
Nagaraju C.Hi Nagarju,
You can try this:
For all 3 requirements, make 3 screens: then for each of your screen , suppose for screen 1, Give 1 transaction name..similiarly for rest 2.
You can make 3 screens by putting screen group for 3 push buttons on the main screen and disable rest 2 one by one..
Hope it will help you,
Regards,
Nikita -
How to stop the activity clipboard linkage between two transactions?
Hi Experts,
We are using CRM 2007. In CRM, since there is no check that the agent needs to work on transactions related to once customer at a time, our agents are able to work on different different transactions belonging to different customers one after another.
As a result, transactions belonging to two different customers are getting linked in the Activity Clipboard of interaction Record as well as Service Order transactions.
We need to place a check so that before the link is created, we can compare the customers of the two transactions and if they differ, we should not create the link. Can you please guide me where is the best place to put such a check?
As per my analysis, we need to stop the doc flow being created if the transactions have different sold to/customer.
Any pointers/suggestions?
Thanks
RohitHi Rohit
Did you manage to get any solution to this?
if you have, would appreciate if you could share the solution.
Rgds
Rusyinni -
hi
I have got two enitities in one view in bc4j. a master and detail. When I insert a new record in this view I want to insert both entities. The master and the detail entity. Is this possible in bc4j without writing code?
Gr,
ErikThe ordering by default is based on which entity was modified first and placed into the transaction's validation list.
The framework manages the order if two entities are involved in a composition association and master's validate calls super's validateEntity during the master's validation cycle.
Otherwise, you may implement such ordering in subclassed validateEntity() method by invoking validate on the related entity. -
In which method i can upload data to two transactions at a time and how ?
Hi,
Can any body tell me <b>In which method i can upload datas to two transactions at a time and how</b>
Pls tell me the steps if possible.
Thanks
PrabhuduttaHi,
I hope u are talking abt BDC,
If it is BDC's Then you can use both the methods.
Call Transaction or
Session Method.
Ex ..if already a vendor exists then call transaction xk02
if vendor no is not yet created then call transaction xk01.
hope this helps.
santhosh -
User can not add more then two products against one order
Hi frnd,
My requirement is in CRM while creating order using CRMD_ORDER transaction. The user can not be entered more then two products against one order.
I am using CRMD_ORDERADM_I_BADI badi to give error I am unable to use this badi. Is there any other options are there.
Please do need full help.
Regards,
Ashish.Hi Amit,
DATA: gt_header TYPE crmd_orderadm_h. "OCCURS 0 WITH HEADER LINE.
data: ET_PRODUCT_I TYPE CRMT_PRODUCT_I_WRKT.
data: gs_PRODUCT_I TYPE CRMT_PRODUCT_I_WRKT.
DATA : gt_header_guid TYPE crmt_object_guid_tab.
DATA : gs_header_guid TYPE crmt_object_guid.
gs_header_guid = IV_HEADER.
*INSERT gs_header_guid INTO TABLE IV_HEADER.
CALL FUNCTION 'CRM_ORDER_READ'
EXPORTING
it_header_guid = gt_header_guid[]
IMPORTING
ET_PRODUCT_I = ET_PRODUCT_I[]
EXCEPTIONS
document_not_found = 1
error_occurred = 2
document_locked = 3
no_change_authority = 4
no_display_authority = 5
no_change_allowed = 6
OTHERS = 7.
endmethod.
I am using ds code. Its working fine records are coming in Product. But how i will save product into one
itab.
Regards,
Ashish S
Maybe you are looking for
-
Memory usage in Analysis Services tabular model
Hello, I've been researching and investigating trying to understand what is consuming memory resources in a tabular model that I'm working with. Using SQL Server Management Studio, the Estimated Size of the database is reported as 7768.34 MBs. Using
-
I recently moved my copy of CS5 to a new PC. I deactivated the license on the old PC and activated it on the new PC. I performed the install using the original CD's (which were purchased directly from Adobe). When I try to run the Update function
-
help?
-
Another newb question: multiple virtual servers
Hi, I have yet another ignorant question. I have several unrelated web projects that I am working on, and I would like to be able to set up a virtual server for each one for testing purposes, such as: http://project1, http://project2, http://project3
-
Please anyone giveme the sample code for how to use JSTL to connect database and fetch the data? Thanx.