Relation table from BW and SAP
Hi Expert,
Please help me about how to find the mapping of SAP table and BW table, I can not see the link of two place of SAP box and BW box.
HieuLM
Hi,
Please note that there is no direct link between BW table fields and R/3 table fields.
In RSOSFIELDMAP table, you can find the mapping between the datasource field(R/3 field) and the infobject in BW/BI system for a particular datasource and source system.
Suppose VBELN field from R/3 has been used in a datasource and you want fo find the infobject in BW to which it has been mapped, then in this table, give VBELN as field and the particular source system name and execute. You would find the Infoobject that will be filled by this field.
Now if you want to find the table of R/3 from where this field VBELN is coming, then take the datasource name from this BW table and go to R/3 system.
If this is a LO datasource, go to LBWE and click on Maintenance for this datasource. You would get the list of fields which would start like MCVBAK VBELN. Here VBAK is table name.
If it is a generic datasource, go to RSO2, give your datasource. From here based on table/ function module you should be able to find the source for this field.
Similar Messages
-
How to pass resultset to the internal table from EIM to SAP's FM
We're testing the data push from EIM to SAP data.
I build a function module
FUNCTION ZLP0105_FUN.
""Local Interface:
*" IMPORTING
*" VALUE(I_IMPORTVARIABLE) TYPE CHAR10 DEFAULT 32
*" TABLES
*" T_TABLE STRUCTURE ZLP0105_FUN OPTIONAL
After the EIM imports the funtion module, the import variable I_IMPORTVARIABLE shows in the EIM, but the structure of the table T_TABLE does not show in EIM. the Structure contains 4 fields.
How can the structure (4fields) show in the EIM?
any help will be greatly appreicated.How are you passing that one single record to the workflow Conatiner
I mean are you using any macro's or FM
See if at all you want to pass a table with multple values then you hvae to use the macro's SWC_SET_TABLE by including the *INCLUDE<CNTN01> in your module pool program and
for SWC_SET_TABLE you have to pass three parameters
SWC_SET_TABLE it_cont 'T_DATA' t_info.
It_cont is of type SWCONT
T_DATA is a workflow conatainer element and the type should be same as your Table control
t_info is a internal with the values that are displyed in your table control. -
Query related to alv grid and sap script
Hi All,
I have a requirement where i should read the values which are selected on the alv grid list output and those values i need to display on the script(layout).
Help me out guru's its an urgency...
thanks in advance .
regards
ravi ganjiHi Ravi,
I have done it exactly like your requirement. This program contains ALV and Smartform.
But whatever may be, both are layouts and having driver program. So just finish your driver program and Script layout and then use this program.
I have written this code to print contact letters from VA42. So, modify this code to insert your transaction code.
Let me know if you have any questions.
Here is the code.
REPORT ILETTER MESSAGE-ID CM.
TYPE POOLS (ALV)
TYPE-POOLS:
slis.
Customized Types
TYPES:
BEGIN OF ty_cntrt,
box(1) TYPE c,
kunnr TYPE kunag,
vbeln TYPE vbeln_va,
vbeln1 TYPE vbeln_va,
vposn TYPE posnr,
vuntdat TYPE vudat_veda,
vbegdat TYPE vbdat_veda,
vdemdat TYPE vddat_veda,
venddat TYPE vndat_veda,
END OF ty_cntrt,
single line TYPES
BEGIN OF ty_vkorg,
vkorg TYPE vkorg,
END OF ty_vkorg.
Constants
CONSTANTS:
c_sform TYPE char10 VALUE 'SMARTFORMS',
c_tcode TYPE sy-tcode VALUE 'VA42',
c_mode TYPE c VALUE 'N',
c_updat TYPE c VALUE 'A',
c_batch TYPE sy-callr VALUE 'BATCH',
c_dclick TYPE char10 VALUE '&IC1'.
Internal tables
DATA: it_cntrt TYPE TABLE OF ty_cntrt,
it_bdc TYPE TABLE OF bdcdata,
it_mesg TYPE TABLE OF bdcmsgcoll,
it_const TYPE TABLE OF /SIE/SSG_XCM_CUC,
it_vkorg TYPE TABLE OF ty_vkorg.
Work areas
DATA: wa_cntrt TYPE ty_cntrt,
wa_bdc TYPE bdcdata,
wa_const TYPE /SIE/SSG_XCM_CUC,
w_vbak TYPE vbak,
w_veda TYPE veda,
w_xcm_pr TYPE /sie/ssg_xcm_pr,
w_vkorg TYPE ty_vkorg.
Variables
DATA: l_repid TYPE sy-repid,
l_vakey TYPE vakey,
l_variant TYPE varid-variant,
l_vbeln TYPE i,
l_vkorg TYPE i,
l_vkbur TYPE i,
l_vkgrp TYPE i,
l_ckappl(40) TYPE c,
l_ckschl(40) TYPE c,
l_cauart(40) TYPE c.
Program Constants
DATA: c_kappl TYPE kappl,
c_kschl TYPE kschl,
c_auart TYPE auart,
c_repco TYPE /sie/ssg_xcm_const,
c_value TYPE /sie/ssg_xcm_value.
ALV data declarations
DATA:
gt_fieldcat TYPE slis_t_fieldcat_alv,
gt_tab_group TYPE slis_t_sp_group_alv,
gs_layout TYPE slis_layout_alv,
gs_repid TYPE sy-repid,
gs_sort TYPE TABLE OF slis_sortinfo_alv.
Selection screen
SELECTION-SCREEN BEGIN OF BLOCK indletter WITH FRAME TITLE text-001.
skip one line
SELECTION-SCREEN SKIP.
SELECT-OPTIONS:
contract
so_vbeln FOR w_vbak-vbeln,
category
so_auart FOR w_vbak-auart NO-DISPLAY,
Sales Org
so_vkorg FOR w_vbak-vkorg OBLIGATORY,
Dis Channel
so_vtweg FOR w_vbak-vtweg,
Division
so_spart FOR w_vbak-spart,
Sales Group
so_vkgrp FOR w_vbak-vkgrp,
Sales Office
so_vkbur FOR w_vbak-vkbur OBLIGATORY,
Cancellation Procedure
so_vkues FOR w_veda-vkuesch OBLIGATORY,
Contract Signed Date
so_vuntd FOR w_veda-vuntdat,
created by
so_ernam FOR w_vbak-ernam,
Fixed Indexation formula
so_fnum FOR w_xcm_pr-fnum OBLIGATORY.
skip one line
SELECTION-SCREEN SKIP.
Indexation letter
PARAMETERS: rb_index RADIOBUTTON GROUP radi USER-COMMAND usr.
Follow up report
PARAMETERS: rb_follo RADIOBUTTON GROUP radi.
skip one line
SELECTION-SCREEN SKIP.
Manual processing checkbox
PARAMETERS: p_manpr AS CHECKBOX.
SELECTION-SCREEN END OF BLOCK indletter.
Printer block
SELECTION-SCREEN BEGIN OF BLOCK blk_par WITH FRAME TITLE text-002.
Printer
PARAMETERS: p_print LIKE nast-ldest DEFAULT 'LOCL' OBLIGATORY.
SELECTION-SCREEN END OF BLOCK blk_par.
User selection data validation
AT SELECTION-SCREEN ON so_vkorg.
Ragne for sales org
RANGES: r_vkorg FOR vbak-vkorg.
REFRESH: it_const, r_vkorg.
CLEAR wa_const.
Proceed for execution only for Sales Orgs in /SIE/SSG_XCM_CUC
LOOP AT so_vkorg.
r_vkorg-sign = 'I'.
r_vkorg-option = 'EQ'.
r_vkorg-low = so_vkorg-low.
APPEND r_vkorg.
Check Sales Org intervals entered in the selection screen
IF NOT so_vkorg-high IS INITIAL.
Get all Sales Org for interval
SELECT vkorg FROM tvko INTO TABLE it_vkorg
WHERE vkorg BETWEEN so_vkorg-low AND so_vkorg-high.
IF sy-subrc = 0.
Add all Sales org into one internal table
LOOP AT it_vkorg INTO w_vkorg.
r_vkorg-low = w_vkorg-vkorg.
APPEND r_vkorg.
CLEAR: w_vkorg.
ENDLOOP.
delete repeated records
DELETE ADJACENT DUPLICATES FROM r_vkorg COMPARING low.
ENDIF.
ENDIF.
CLEAR r_vkorg.
ENDLOOP.
Get Sales Org entries maintained in /SIE/SSG_XCM_CUC
l_repid = sy-repid.
Check Sales Org is maintained for Renewal Letter?
LOOP AT r_vkorg.
concatenate constant with Sales Org
CONCATENATE 'INX_LETTER_CREATE_' r_vkorg-low INTO c_repco.
Get constant
SELECT SINGLE value
FROM /sie/ssg_xcm_cuc
INTO c_value
WHERE repid = l_repid
AND const = c_repco
AND vkorg EQ so_vkorg-low.
Check alerady maintained?
IF sy-subrc <> 0 OR
( sy-subrc = 0 AND c_value <> 'X' ).
Issue massage 'Sales Org no permitted for renewal Letter'.
MESSAGE E012.
CLEAR: c_repco, r_vkorg.
EXIT.
ENDIF.
CLEAR: c_repco, r_vkorg.
ENDLOOP.
AT SELECTION-SCREEN.
Read single Sales Org
READ TABLE so_vkorg INDEX 1.
IF sy-subrc = 0.
CLEAR: l_ckappl, l_ckschl, l_cauart, c_kappl, c_kschl, c_auart.
for application
CONCATENATE 'INX_LETTER_V1_' so_vkorg-low INTO l_ckappl.
for output type
CONCATENATE 'INX_LETTER_Y6C4_' so_vkorg-low INTO l_ckschl.
document type
CONCATENATE 'INX_LETTER_AUART_' so_vkorg-low INTO l_cauart.
Get application
SELECT SINGLE value FROM /sie/ssg_xcm_cuc
INTO c_kappl WHERE repid = sy-repid AND const LIKE l_ckappl.
Get output type
SELECT SINGLE value FROM /sie/ssg_xcm_cuc
INTO c_kschl WHERE repid = sy-repid AND const LIKE l_ckschl.
Get document type
SELECT SINGLE value FROM /sie/ssg_xcm_cuc
INTO c_auart WHERE repid = sy-repid AND const LIKE l_cauart.
ENDIF.
find no of Sales org entries entered in the selection screen
DESCRIBE TABLE so_vkorg LINES l_vkorg.
find no of Sales office entries entered in the selection screen
DESCRIBE TABLE so_vkbur LINES l_vkbur.
find no of Sales Group entries entered in the selection screen
DESCRIBE TABLE so_vkgrp LINES l_vkgrp.
Check if enterred more than one entry
IF l_vkorg = 1 AND l_vkbur = 1.
add Sales Org, Sales office, Sales group for key
IF NOT so_vkgrp[] IS INITIAL.
CONCATENATE so_vkorg-low so_vkbur-low so_vkgrp-low INTO l_vakey.
ELSE.
CONCATENATE so_vkorg-low so_vkbur-low '%' INTO l_vakey.
ENDIF.
CONDENSE l_vakey.
Get printer name for selection.
SELECT SINGLE ldest FROM nach INTO p_print
WHERE kappl = c_kappl AND kschl = c_kschl AND vakey LIKE l_vakey.
ENDIF.
Manual processing is possible for Renewal Letter in advance only
IF p_manpr = 'X' AND rb_follo = 'X'.
MESSAGE E017.
ENDIF.
Main Processing
START-OF-SELECTION.
Check for the Follow up report
IF rb_follo = 'X'.
Call Follow up report with Selection criteria
SUBMIT /SIE/SWE_XCM_INDEX_FOLLOWUP
USING SELECTION-SET l_variant
WITH so_vbeln IN so_vbeln
WITH so_vkorg IN so_vkorg
WITH so_vtweg IN so_vtweg
WITH so_spart IN so_spart
WITH so_vkgrp IN so_vkgrp
WITH so_vkbur IN so_vkbur
WITH so_vkues IN so_vkues
WITH so_vuntd IN so_vuntd
WITH so_ernam IN so_ernam
WITH so_fnum IN so_fnum
WITH p_kappl EQ c_kappl
WITH p_kschl EQ c_kschl
WITH p_auart EQ c_auart
AND RETURN.
ELSE.
Process for Indexation Report
gs_repid = sy-repid.
Get data.
PERFORM get_data.
Filter data based on Siemens France rules
PERFORM process_data.
Check contract data is available for selection criteria
IF NOT it_cntrt[] IS INITIAL.
create ALV output header
PERFORM alv_fieldcat USING gt_fieldcat[].
create ALV layout
PERFORM alv_layout CHANGING gs_layout.
Sort ALV output
PERFORM alv_sort.
display filtered contract data
PERFORM output_data.
ELSE.
Display a message 'No records found'.
MESSAGE I011.
EXIT.
ENDIF.
ENDIF.
*& Form get_data
Retrieve contracts data from tables
--> p1 text
<-- p2 text
FORM get_data.
Get contract data from VBAK and VEDA.
SELECT avbeln aaudat a~kunnr
bvuntdat bvbegdat
bvdemdat bvenddat
INTO CORRESPONDING FIELDS OF TABLE it_cntrt
FROM vbak AS a INNER JOIN veda AS b
ON avbeln = bvbeln
WHERE a~vbeln IN so_vbeln
AND a~auart EQ c_auart
AND a~vkorg IN so_vkorg
AND a~vtweg IN so_vtweg
AND a~spart IN so_spart
AND a~vkgrp IN so_vkgrp
AND a~vkbur IN so_vkbur
AND a~ernam IN so_ernam
AND b~vposn = '000000'
AND b~vkuesch IN so_vkues
AND b~vuntdat IN so_vuntd.
ENDFORM. " get_data
*& Form process_data
text
--> p1 text
<-- p2 text
FORM process_data.
Internal tables
DATA: l_nast TYPE TABLE OF nast,
it_pr TYPE TABLE OF /sie/ssg_xcm_pr.
Work areas
DATA: w_nast TYPE nast,
wa_pr TYPE /sie/ssg_xcm_pr.
local Variables
DATA: l_datum1 TYPE sy-datum,
l_datum2 TYPE sy-datum,
l_d3last TYPE sy-datum,
l_d3next TYPE sy-datum.
current date.
l_datum1 = sy-datum.
Calcuate date after 3 months.
CALL FUNCTION 'DATE_CREATE'
EXPORTING
ANZAHL_MONATE = 3
DATUM_EIN = l_datum1
IMPORTING
DATUM_AUS = l_datum2.
l_datum2 = l_datum2 - 1.
SORT it_cntrt BY KUNNR VBELN.
Get corresponding records from /SIE/SSG_XCM_PR.
SELECT vbeln posnr fnum
FROM /SIE/SSG_XCM_PR
INTO CORRESPONDING FIELDS OF TABLE it_pr
FOR ALL ENTRIES IN it_cntrt
WHERE vbeln = it_cntrt-vbeln
AND posnr = it_cntrt-vposn
AND fnum IN so_fnum.
clear workarea
CLEAR wa_cntrt.
filter contracts agaist the table /SIE/SSG_XCM_PR records.
LOOP AT it_cntrt INTO wa_cntrt.
CLEAR wa_pr.
check contracts available in table /SIE/SSG_XCM_PR
READ TABLE it_pr INTO wa_pr WITH KEY vbeln = wa_cntrt-vbeln.
IF sy-subrc <> 0.
DELETE it_cntrt.
CLEAR wa_pr.
CONTINUE.
ELSEIF sy-subrc = 0 AND NOT wa_pr-fnum IN so_fnum.
if not available, do not consider this contract
DELETE it_cntrt.
CLEAR wa_pr.
CONTINUE.
ENDIF.
Dont consider contracts expires before today and after 3 months.
IF wa_cntrt-vdemdat > l_datum1. "current date
IF wa_cntrt-vdemdat(6) > l_datum2(6). "AND "after 3 months
delete contract
DELETE it_cntrt.
CLEAR wa_cntrt.
CONTINUE.
ENDIF.
ELSE.
DELETE it_cntrt.
CLEAR wa_cntrt.
CONTINUE.
ENDIF.
Is contract renewal letter has been sent already?
Get all records from NAST to find letter sent?
SELECT kappl objky kschl nacha datvr
FROM NAST
INTO CORRESPONDING FIELDS OF TABLE l_nast
WHERE kappl = c_kappl
AND objky = wa_cntrt-vbeln
AND kschl = c_kschl
AND nacha = '1'.
IF sy-subrc = 0.
sort renewal letter sent dates by latest is first
SORT l_nast BY datvr DESCENDING.
Get latest nast record
READ TABLE l_nast INTO w_nast INDEX 1.
IF sy-subrc = 0.
IF p_manpr <> 'X'. " ignore 3 month logic
l_d3next = wa_cntrt-vdemdat(06).
l_d3next+6(2) = '01'.
Calcuate date after 3 months.
CALL FUNCTION 'DATE_CREATE'
EXPORTING
ANZAHL_MONATE = -3
DATUM_EIN = l_d3next
IMPORTING
DATUM_AUS = l_d3last.
l_d3last = l_d3last + 1.
Check letter already sent year equals current year
IF w_nast-datvr BETWEEN l_d3last AND wa_cntrt-vdemdat.
do not consider it
DELETE it_cntrt.
CLEAR: l_d3last, wa_cntrt, w_nast, l_d3next.
CONTINUE.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
no leading zeros to contract
WRITE wa_cntrt-vbeln TO wa_cntrt-vbeln1 NO-ZERO.
modify internal table
MODIFY it_cntrt FROM wa_cntrt.
CLEAR: l_nast, w_nast.
ENDLOOP.
ENDFORM. " process_data
*& Form output_data
text
--> p1 text
<-- p2 text
FORM output_data.
Display output in a ALV Grid
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = gs_repid
I_CALLBACK_PF_STATUS_SET = 'ALV_STATUS'
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
IS_LAYOUT = gs_layout
IT_FIELDCAT = gt_fieldcat
IT_SORT = gs_sort
I_SAVE = 'A'
TABLES
T_OUTTAB = it_cntrt
EXCEPTIONS
PROGRAM_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.
ENDFORM. " output_data
*& Form alv_header
text
--> p1 text
<-- p2 text
FORM alv_fieldcat USING gs_fieldcat TYPE slis_t_fieldcat_alv.
DATA: ls_fieldcat TYPE slis_fieldcat_alv.
Sold-to Party header
ls_fieldcat-col_pos = 1.
ls_fieldcat-fieldname = 'KUNNR'.
ls_fieldcat-seltext_m = 'Sold-to Party'.
ls_fieldcat-outputlen = 14.
ls_fieldcat-datatype = 'CHAR'.
ls_fieldcat-key = 'X'.
APPEND ls_fieldcat TO gs_fieldcat.
CLEAR ls_fieldcat.
Contract number
ls_fieldcat-col_pos = 2.
ls_fieldcat-fieldname = 'VBELN'.
ls_fieldcat-seltext_m = 'Contract Number'.
ls_fieldcat-outputlen = 20.
ls_fieldcat-datatype = 'CHAR'.
APPEND ls_fieldcat TO gs_fieldcat.
CLEAR ls_fieldcat.
Contract Signed Date
ls_fieldcat-col_pos = 3.
ls_fieldcat-fieldname = 'VUNTDAT'.
ls_fieldcat-seltext_m = 'Contract signed date'.
ls_fieldcat-outputlen = 20.
ls_fieldcat-datatype = 'DATS'.
APPEND ls_fieldcat TO gs_fieldcat.
CLEAR ls_fieldcat.
Contract Start Date
ls_fieldcat-col_pos = 4.
ls_fieldcat-fieldname = 'VBEGDAT'.
ls_fieldcat-seltext_m = 'Contract start date'.
ls_fieldcat-outputlen = '20'.
ls_fieldcat-datatype = 'DATS'.
APPEND ls_fieldcat TO gs_fieldcat.
CLEAR ls_fieldcat.
Dismantling date
ls_fieldcat-col_pos = 5.
ls_fieldcat-fieldname = 'VDEMDAT'.
ls_fieldcat-seltext_m = 'Dismantling date'.
ls_fieldcat-outputlen = 14.
ls_fieldcat-datatype = 'DATS'.
APPEND ls_fieldcat TO gs_fieldcat.
CLEAR ls_fieldcat.
ENDFORM. " alv_header
*& Form alv_layout
text
--> p1 text
<-- p2 text
FORM alv_layout USING ls_layout TYPE slis_layout_alv.
No input
ls_layout-no_input = 'X'.
Column width is flexible
ls_layout-colwidth_optimize = 'X'.
ls_layout-box_fieldname = 'BOX'.
ls_layout-info_fieldname = 'LINE_COLOR'.
ls_layout-zebra = 'X'.
ls_layout-get_selinfos = 'X'.
ls_layout-reprep = 'X'.
ENDFORM. " alv_layout
*& Form alv_status
text
--> p1 text
<-- p2 text
FORM alv_status USING rt_extab TYPE slis_t_extab.
GUI Status and Application Toolbar
SET PF-STATUS '/SIE/SWE_XCM_INDEXLE'.
ENDFORM.
*& Form user_command
text
--> p1 text
<-- p2 text
FORM user_command USING l_ucomm LIKE sy-ucomm
l_selfield TYPE slis_selfield.
RANGES: r_kappl FOR nast-kappl,
r_objky FOR nast-objky,
r_kschl FOR nast-kschl,
r_nacha FOR nast-nacha.
DATA: l_jobname TYPE TBTCJOB-JOBNAME,
l_jobcount TYPE TBTCJOB-JOBCOUNT,
l_repid TYPE sy-repid,
l_print_params TYPE PRI_PARAMS,
l_arc_params TYPE ARC_PARAMS,
l_valid TYPE c,
l_retcode TYPE sy-subrc,
l_blines TYPE i.
CASE l_ucomm.
Process button seleted
WHEN c_sform.
process selected records.
LOOP AT it_cntrt INTO wa_cntrt.
IF wa_cntrt-box = 'X'.
place output type in the contract
PERFORM bdc_output USING wa_cntrt
CHANGING l_retcode.
IF l_retcode = 0.
add record for jobground job
r_objky-sign = 'I'.
r_objky-option = 'EQ'.
r_objky-low = wa_cntrt-vbeln.
APPEND r_objky.
ENDIF.
CLEAR: wa_cntrt, l_retcode, r_objky.
ENDIF.
ENDLOOP.
WHEN c_dclick.
set contract number id with the selected contract
SET PARAMETER ID 'AUN' FIELD l_selfield-value.
SET PARAMETER ID 'KTN' FIELD l_selfield-value.
call va42 tcode when double click on contract
CALL TRANSACTION c_tcode AND SKIP FIRST SCREEN.
ENDCASE.
DESCRIBE TABLE r_objky LINES l_blines.
IF NOT r_objky[] IS INITIAL.
IF l_blines > 0.
Background job name.
CONCATENATE 'XCM_INDEXATION' sy-uname '_' sy-uzeit
INTO l_jobname.
Application
r_kappl-sign = 'I'.
r_kappl-option = 'EQ'.
r_kappl-low = 'V1'.
APPEND r_kappl.
Message Type
r_kschl-sign = 'I'.
r_kschl-option = 'EQ'.
r_kschl-low = c_kschl.
APPEND r_kschl.
Message transmission medium
r_nacha-sign = 'I'.
r_nacha-option = 'EQ'.
r_nacha-low = '1'.
APPEND r_nacha.
l_repid = sy-repid.
Print Parameters
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING
DESTINATION = p_print
MODE = c_batch
NO_DIALOG = 'X'
REPORT = l_repid
EXPIRATION = 2
IMMEDIATELY = 'X'
NEW_LIST_ID = 'X'
IMPORTING
OUT_ARCHIVE_PARAMETERS = l_arc_params
OUT_PARAMETERS = l_print_params
VALID = l_valid
EXCEPTIONS
ARCHIVE_INFO_NOT_FOUND = 1
INVALID_PRINT_PARAMS = 2
INVALID_ARCHIVE_PARAMS = 3
OTHERS = 4.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
opening the job
CALL FUNCTION 'JOB_OPEN'
EXPORTING
JOBNAME = l_jobname
IMPORTING
JOBCOUNT = l_jobcount
EXCEPTIONS
CANT_CREATE_JOB = 1
INVALID_JOB_DATA = 2
JOBNAME_MISSING = 3
OTHERS = 4.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Job submit
SUBMIT /sie/swe_xcm_index_rsnast00 TO SAP-SPOOL
USER sy-uname
WITH s_kappl IN r_kappl
WITH s_objky IN r_objky
WITH s_kschl IN r_kschl
WITH s_nacha IN r_nacha
WITH p_print EQ p_print
VIA JOB l_jobname NUMBER l_jobcount
SPOOL PARAMETERS l_print_params
WITHOUT SPOOL DYNPRO
AND RETURN.
IF sy-subrc <> 0.
display message when error in scheduling background job
MESSAGE E016 WITH 'Error scheduling Job'.
ENDIF.
Job close
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
JOBCOUNT = l_jobcount
JOBNAME = l_jobname
STRTIMMED = 'X'
EXCEPTIONS
CANT_START_IMMEDIATE = 1
INVALID_STARTDATE = 2
JOBNAME_MISSING = 3
JOB_CLOSE_FAILED = 4
JOB_NOSTEPS = 5
JOB_NOTEX = 6
LOCK_FAILED = 7
OTHERS = 8.
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.
ENDFORM.
*& Form bdc_output
text
--> p1 text
<-- p2 text
FORM bdc_output USING wa_cntrt TYPE ty_cntrt
CHANGING l_retcode TYPE sy-subrc.
DATA: l_nast TYPE TABLE OF nast,
it_nast TYPE TABLE OF nast,
w_nast TYPE nast,
l_cellno(2) TYPE n,
l_vbelv TYPE vbfa-vbelv,
l_vbpa TYPE vbpa,
l_yes(1),
l_temp(40) TYPE c,
l_lines TYPE i,
l_lesscnt TYPE i,
l_less(1),
l_lines1(2) TYPE n.
REFRESH: it_nast, l_nast, it_bdc.
CLEAR: l_nast, w_nast, l_yes, l_cellno,
it_nast, l_nast, it_bdc.
PERFORM dyn_scr USING 'SAPMV45A' '0102' 'X'.
PERFORM dyn_fld USING 'VBAK-VBELN' wa_cntrt-vbeln.
PERFORM dyn_fld USING 'BDC_OKCODE' '/00'.
PERFORM dyn_scr USING 'SAPMV45A' '4001' 'X'.
PERFORM dyn_fld USING 'BDC_OKCODE' '=HEAD'.
PERFORM dyn_scr USING 'SAPMV45A' '4002' 'X'.
PERFORM dyn_fld USING 'BDC_OKCODE' '=KDOK'.
SELECT *
FROM nast
INTO CORRESPONDING FIELDS OF TABLE l_nast
WHERE kappl = c_kappl
AND objky = wa_cntrt-vbeln.
IF sy-subrc = 0.
SORT l_nast BY kschl vstat.
DESCRIBE TABLE l_nast LINES l_lines.
LOOP AT l_nast INTO w_nast.
l_cellno = sy-tabix.
IF w_nast-kschl = c_kschl AND w_nast-vstat = 0.
EXIT.
ENDIF.
IF w_nast-kschl > c_kschl OR
( w_nast-kschl = c_kschl AND w_nast-vstat <> 0 ).
IF l_less = space.
l_cellno = l_cellno - 1.
ENDIF.
CLEAR l_less.
IF l_cellno = 0.
l_cellno = 1.
ENDIF.
l_lines = l_lines + 1.
l_lines1 = l_lines.
PERFORM dyn_scr USING 'SAPDV70A' '0100' 'X'.
CONCATENATE 'DNAST-KSCHL(' l_lines1 ')' INTO l_temp.
CONDENSE l_temp.
PERFORM dyn_fld USING l_temp 'Y6C4'.
CLEAR: l_temp, l_lines, l_lines1.
PERFORM dyn_fld USING 'BDC_OKCODE' '/00'.
EXIT.
ELSEIF w_nast-kschl < c_kschl.
l_less = 'X'.
l_lesscnt = l_lesscnt + 1.
ENDIF.
ENDLOOP.
ELSE.
l_cellno = '01'.
PERFORM dyn_scr USING 'SAPDV70A' '0100' 'X'.
CONCATENATE 'DNAST-KSCHL(' l_cellno ')' INTO l_temp.
CONDENSE l_temp.
PERFORM dyn_fld USING l_temp 'Y6C4'.
CLEAR l_temp.
PERFORM dyn_fld USING 'BDC_OKCODE' '/00'.
ENDIF.
IF l_less = 'X'.
l_lesscnt = l_lesscnt + 1.
l_cellno = l_lesscnt.
l_lines = l_lines + 1.
l_lines1 = l_lines.
PERFORM dyn_scr USING 'SAPDV70A' '0100' 'X'.
CONCATENATE 'DNAST-KSCHL(' l_lines1 ')' INTO l_temp.
CONDENSE l_temp.
PERFORM dyn_fld USING l_temp 'Y6C4'.
CLEAR: l_temp, l_lines, l_lines1.
PERFORM dyn_fld USING 'BDC_OKCODE' '/00'.
ENDIF.
PERFORM dyn_scr USING 'SAPDV70A' '0100' 'X'.
CONCATENATE 'DV70A-SELKZ(' l_cellno ')' INTO l_temp.
CONDENSE l_temp.
PERFORM dyn_fld USING l_temp 'X'.
CLEAR l_temp.
PERFORM dyn_fld USING 'BDC_OKCODE' '=V70P'.
PERFORM dyn_scr USING 'SAPDV70A' '0101' 'X'.
PERFORM dyn_fld USING 'NAST-LDEST' p_print.
PERFORM dyn_fld USING 'NAST-DIMME' 'X'.
PERFORM dyn_fld USING 'NAST-TDARMOD' '1'.
PERFORM dyn_fld USING 'BDC_OKCODE' '=V70B'.
PERFORM dyn_scr USING 'SAPDV70A' '0100' 'X'.
CONCATENATE 'DV70A-SELKZ(' l_cellno ')' INTO l_temp.
CONDENSE l_temp.
PERFORM dyn_fld USING l_temp 'X'.
CLEAR l_temp.
PERFORM dyn_fld USING 'BDC_OKCODE' '=V70I'.
PERFORM dyn_scr USING 'SAPDV70A' '0102' 'X'.
PERFORM dyn_fld USING 'NAST-VSZTP' '1'.
PERFORM dyn_fld USING 'BDC_OKCODE' '=V70B'.
PERFORM dyn_scr USING 'SAPDV70A' '0100' 'X'.
PERFORM dyn_fld USING 'BDC_OKCODE' '=V70S'.
CALL TRANSACTION c_tcode USING it_bdc
MODE c_mode "'N'
UPDATE c_updat "'A'
MESSAGES INTO it_mesg.
IF sy-subrc = 0.
l_retcode = 0.
ENDIF.
ENDFORM. " bdc_output
*& Form dyn_scr
text
-->P_0642 text
-->P_0643 text
-->P_0644 text
FORM dyn_scr USING P_0642
P_0643
P_0644.
MOVE: p_0642 TO wa_bdc-program,
p_0643 TO wa_bdc-dynpro,
p_0644 TO wa_bdc-dynbegin.
APPEND wa_bdc TO it_bdc.
CLEAR wa_bdc.
ENDFORM. " dyn_scr
*& Form dyn_fld
text
-->P_0654 text
-->P_0655 text
FORM dyn_fld USING P_0654
P_0655.
MOVE: p_0654 TO wa_bdc-fnam,
p_0655 TO wa_bdc-fval.
APPEND wa_bdc TO it_bdc.
CLEAR wa_bdc.
ENDFORM. " dyn_fld
*& Form alv_sort
text
FORM alv_sort.
DATA: wa_sortcat TYPE slis_sortinfo_alv.
WA_SORTCAT-SPOS = 1.
WA_SORTCAT-FIELDNAME = 'KUNNR'.
WA_SORTCAT-UP = 'X'.
WA_SORTCAT-EXPA = 'X'.
Appending gd_sortcat-tabname
APPEND WA_SORTCAT TO gs_sort.
CLEAR wa_sortcat.
WA_SORTCAT-SPOS = 2.
WA_SORTCAT-FIELDNAME = 'VBELN'.
WA_SORTCAT-UP = 'X'.
WA_SORTCAT-EXPA = 'X'.
Appending gd_sortcat-tabname
APPEND WA_SORTCAT TO gs_sort.
WA_SORTCAT-SPOS = 3.
WA_SORTCAT-FIELDNAME = 'VUNTDAT'.
WA_SORTCAT-UP = 'X'.
WA_SORTCAT-EXPA = 'X'.
Appending gd_sortcat-tabname
APPEND WA_SORTCAT TO gs_sort.
ENDFORM. " alv_sort -
SAP Inbound email related query (from Outlook to SAP)
Hi,
I am in a situation where I have to send email from MS Outlook to SAP with a PDF file as an attachment. The PDF file will be stripped into an XML file and processed further and a reply is sent to the user sending the email. The Outlook admins have set up the necessary config for the connectivity - I am able to send the PDF file from Outlook to SAP (everything has been configured using SICF, SCOT etc) for inbound processing. In SCOT - Settings->Inbound processing I have used a Class which implements interface IF_INBOUND_EXIT_BCS (as per one of the blogs by Jeff Gebo). I can see the trace file in SCOT ->Utilities->Trace->Internal trace. When I send the PDF file, I can see in the trace (I cannot debug as the SAPCONNECT user which gets called in the backgound triggers the user exit class). In the trace file I can see my class gets instantiated but the next step to read the PDF file fails. The code come the Jeff's blog which I use is as follows:
Set return code so that no other Inbound Exist class will be called
e_retcode = IF_INBOUND_EXIT_BCS=>gc_terminate.
try.
Get the email document that was sent.
data: document type ref to if_document_bcs.
document = io_sreq->get_document( ).
Get the sender's address to reply back
lv_sender = io_sreq->get_sender( ).
addr = lv_sender->address_string( ).
return_addr = addr.
Get the interactive form attachment.
data: pdf_table type BCSS_DBPC.
pdf_table = document->get_body_part_content( 2 ).
Convert the pdf table into an xstring.
data: pdf_xstring type xstring,
pdf_line type solix.
clear pdf_xstring.
loop at pdf_table-cont_hex into pdf_line.
concatenate pdf_xstring pdf_line-line into pdf_xstring in byte mode.
endloop.
Process the PDF form
data: formxml type string.
formxml = me->process_form( pdf = pdf_xstring ).
Here the contents of the pdf_table-cont_hex is blank (I used a table to populate the values). All I get in my Outlook inbox is a empty email with an empty subject from SAP (called by the instantiated class of the Interface)
The irony is that I setup the same procedure has been configured and setup in another totally different SAP system and everything works fine there - I did a comparision of both SAP systems and everything seems fine (config wise and user exit class wise) and everything is identical. I have no clue as to why it works in one system and not in the other system.
If anyone has any pointers wit will be greatly appreciated as I am on a tight deadline - I have checked OSS but with no help.
Thanks in advance,
RyanYou may be able to find more information by putting an infinite loop at the beginning of your user exit:
x = ' '.
while x = ' '.
x = ' '.
endwhile.
and then go into debugging via SM50 and set the x variable to break out of the loop.
This technique is useful debugging workflows and other code which you cannot get to directly by placing a break-point.
Andrew -
Need To Create a table in Sql Server and do some culculation into the table from Oracle and Sql
Hello All,
I'm moving a data from Oracle to Sql Server with ETL (80 tables with data) and i want to track the number of records that i moving on the daily basis , so i need to create a table in SQL Server, wilth 4 columns , Table name, OracleRowsCount, SqlRowCount,
and Diff(OracleRowsCount - SqlRowCount) that will tell me the each table how many rows i have in Oracle, how many rows i have in SQL after ETL load, and different between them, something like that:
Table Name OracleRowsCount SqlRowCount Diff
Customer 150 150
0
Sales 2000 1998
2
Devisions 5 5
0
(I can add alot of SQL Tasks and variables per each table but it not seems logicly to do that, i tryid to find a way to deal with that in vb but i didn't find)
What the simplest way to do it ?
Thank you
Best Regards
DanielHi Daniel,
According to your description, what you want is an indicator to show whether all the rows are inserted to the destination table. To achieve your goal, you can add a Row Count Transformation following the OLE DB Destination, and redirect bad rows to the Row
Count Transformation. This way, we can get the count of the bad rows without redirecting these rows. Since the row count value is stored in a variable, we can create another string type variable to retrieve the row count value from the variable used by the
Row Count Transformation, and then use a Send Mail Task to send the row count value in an email message body. You can also insert the row count value to the SQL Server table through Execute SQL Task. Then, you can check whether bad rows were generated in the
package by querying this table.
Regards,
Mike Yin
TechNet Community Support -
Relation table between Opportunity and Activity.
Can any one help me to know,In which table relationships are maintained between Opportunity,Activity,Account etc
Dear frnd,
pls find below for relations..
2.1 Master Data Tables
Table Name Description
Business Partner
BUT000 BP: General data
Contains Business Partner Number, Partner Category, Partner Type, First Name, Last Name etc.
BUT020 BP: Addresses
BUT050 BP relationships/role definitions: General data
Contains Relationship, Partner Number (PARTNER1), Relationship Category
BUT051 BP Relationship: Contact Person Relationship
Similar to BUT050 , additionally contains Contact Persons Address data
BUT0BK Business Partner: Bank Data & Details
BP Number, Bank Key, Bank Country Key, Bank Account Number
BNKA Bank Master Data
BUT100 BP: Roles
ADR2 Telephone Numbers (Business Address Services)
ADR6 SMTP Numbers (Business Address Services)
Contains Email Id of the BP.
ADRC Addresses (Business Address Services)
BPs Complete Address Details- City, Country, Post Code, District, Street, Title No Etc
TSAD3T Table containing the Title text against a Title No.
Note:
Pass the langu key with the
language in which you want the
text.
COMM_PRODUCT Master Table for Product
CRMM_BUAG Master table for Business Agreement
CRMM_BUAG_H Header Data for Business Agreement such as Tax Category, Tax Characteristic, Form key, Business Agreement Class. Data in this table correspond to ISU Contract account table FKKVKP.
CRMM_BABR_H Rule data for business agreements data in this table correspond to ISU Contract account table FKKVK
Business Transaction(Service Contracts in Particular)
CNCCRMPRCUSZZBUR Condition Records for Service Contracts. We get Basic Unit Rate, Standing Charge Rate etc.
(This is a Z table used in a leading ISU SAP-CRM implementation. You can give the table SAP0090 this is a standard table. in general all condition tables have the naming convention CNCC*)
CRMD_ORDERADM_H Contains the Header Information for a Business Transaction.
Note:
1. It doesnt store the Business Partner
responsible for the transaction. To
get the Partner No, link it with
CRM_ORDER_INDEX.
2. This table can be used for search
based on the Object Id(Business
Transaction No).
CRMD_CUSTOMER_H Additional Site Details at the Header Level of a Business Transaction
CRMC_PROC_TYPE Master table Business Transaction Type
CRMC_PARTNER_FCT Definition of Partner Functions
SCPRIOT Priorities for Activities with priority text.
Note:
Pass the langu key with the
language in which you want the
text.
CRMC_PROC_TYPE_T Text for a transaction type
CRMC_ACT_OBJ_T Objective Number and Text for Activities
TJ30T All the status code and text
CRMC_PR_ASSIGN Transaction Type and its Transaction Type Object.
IBIB Installed Base/Ibase
IBIN Installed Base Components
2.2 Transaction Data Tables
Table Name Description
CRMD_LINK Transaction GUID set for all the Business Transactions
CRMD_ORDER_INDEX Contains Header as well as Item details for a Business Transaction.
Note:
1. It doesnt store the Business
Transaction No (Object ID).
To get the Business Transaction No
link the table with
CRMD_ORDERADM_H
2. This table can be used for search
based on the Partner No
CRMD_ORDERADM_I Stores the Item information for a Business Transaction. The scenarios where we have a Contract Header and within contract we have Line Items for the contract, this table can be useful.
E.g. Service Contracts
CRMD_CUSTOMER_I Additional Site Details at the Item Level of a Service Contract
SCAPPTSEG Table for individual Appointment Types for a transaction.
CRM_JEST Individual Object Status for any business transaction.
CRM_JCDS Current Status for a business transaction along with set date, set time and status code.
2.3 Table Enhancements
Following tables were enhanced as per the project requirement in a leading ISU-SAP CRM implementation. Easy Enhancement workbench can be used for enhancing most of the transactions in CRM.
Table Name Description
BUT000 Fields such as Registration No, SIC Code, Cost to Serve etc. that appear in the additional details tab in BP transaction
CRMM_BUAG_H Fields such as Acc in Legacy, Invoice Output, Clearing Category, Bill Form, Lock Process Type etc. that appear in the Business Agreement tab in BP transaction
CRMD_CUSTOMER_H This table is used as an extension of the service contract header i.e. if there is a requirement to add new fields to CRMD_ORDERADM_H then; this table has to be used to add the fields.
CRMD_CUSTOMER_I This table is used as an extension of the service contract header i.e. if there is a requirement to add new fields to CRMD_ORDERADM_I then; this table has to be used to add the fields. For e.g. fields required for additional site details tab at item level of Service Contract are added to this table. -
Protect sensitive HR tables from ABAPer and BASIS
Hello
We are trying to work out some security authorizations where in we can protect HR master data through direct access to HR tables through SE16 or SM30 for info type tables like PA0008 or PA0015 etc. I know that these tables have authorization group 'PA' and we can build a role using S_TABU_DIS using this autho group but we have about 30 such infotypes to be protected. If we build a role with S_TABU_DIS and Auth group='PA' we will land up protecting all the Infotypes. Other problem is that if we create a new auth group 'ZPA' for these 30 infotype tables, thats too much customization as we might have problems during future upgrades.
My question to the forum members is - What solutions were explored or implemented for such situations?
Thanks
SnehalDear Snehal,
Maintain all such sensitive infotypes in a Z table. Implement a proper BAdi/Enhacement that will be called whenver user accesses the transactions that you want to restrict and validate against that Z table. If the entry exists in Z table raise an error message saying 'You are not authorized' else display.
You would need to bypass this validation for users other than ABAPer or BASIS. For that you may need to maintain proper naming convention or some logic.
Please check this sample program from other thread to find BADI and enhancement for a given transaction code. You just need to create a custom program in your system by cut and paste below codes.
REPORT ZTEST.
TABLES: TSTC,
TADIR,
MODSAPT,
MODACT,
TRDIR,
TFDIR,
ENLFDIR,
SXS_ATTRT ,
TSTCT.
DATA: JTAB LIKE TADIR OCCURS 0 WITH HEADER LINE.
DATA: FIELD1(30).
DATA: V_DEVCLASS LIKE TADIR-DEVCLASS.
PARAMETERS: P_TCODE LIKE TSTC-TCODE,
P_PGMNA LIKE TSTC-PGMNA .
DATA: WA_TADIR TYPE TADIR.
START-OF-SELECTION.
IF NOT P_TCODE IS INITIAL.
SELECT SINGLE * FROM TSTC WHERE TCODE EQ P_TCODE.
ELSEIF NOT P_PGMNA IS INITIAL.
TSTC-PGMNA = P_PGMNA.
ENDIF.
IF SY-SUBRC EQ 0.
SELECT SINGLE * FROM TADIR
WHERE PGMID = 'R3TR'
AND OBJECT = 'PROG'
AND OBJ_NAME = TSTC-PGMNA.
MOVE : TADIR-DEVCLASS TO V_DEVCLASS.
IF SY-SUBRC NE 0.
SELECT SINGLE * FROM TRDIR
WHERE NAME = TSTC-PGMNA.
IF TRDIR-SUBC EQ 'F'.
SELECT SINGLE * FROM TFDIR
WHERE PNAME = TSTC-PGMNA.
SELECT SINGLE * FROM ENLFDIR
WHERE FUNCNAME = TFDIR-FUNCNAME.
SELECT SINGLE * FROM TADIR
WHERE PGMID = 'R3TR'
AND OBJECT = 'FUGR'
AND OBJ_NAME EQ ENLFDIR-AREA.
MOVE : TADIR-DEVCLASS TO V_DEVCLASS.
ENDIF.
ENDIF.
SELECT * FROM TADIR INTO TABLE JTAB
WHERE PGMID = 'R3TR'
AND OBJECT in ('SMOD', 'SXSD')
AND DEVCLASS = V_DEVCLASS.
SELECT SINGLE * FROM TSTCT
WHERE SPRSL EQ SY-LANGU
AND TCODE EQ P_TCODE.
FORMAT COLOR COL_POSITIVE INTENSIFIED OFF.
WRITE:/(19) 'Transaction Code - ',
20(20) P_TCODE,
45(50) TSTCT-TTEXT.
SKIP.
IF NOT JTAB[] IS INITIAL.
WRITE:/(105) SY-ULINE.
FORMAT COLOR COL_HEADING INTENSIFIED ON.
Sorting the internal Table
sort jtab by OBJECT.
data : wf_txt(60) type c,
wf_smod type i ,
wf_badi type i ,
wf_object2(30) type C.
clear : wf_smod, wf_badi , wf_object2.
Get the total SMOD.
LOOP AT JTAB into wa_tadir.
at first.
FORMAT COLOR COL_HEADING INTENSIFIED ON.
WRITE:/1 SY-VLINE,
2 'Enhancement/ Business Add-in',
41 SY-VLINE ,
42 'Description',
105 SY-VLINE.
WRITE:/(105) SY-ULINE.
endat.
clear wf_txt.
at new object.
if wa_tadir-object = 'SMOD'.
wf_object2 = 'Enhancement' .
elseif wa_tadir-object = 'SXSD'.
wf_object2 = ' Business Add-in'.
endif.
FORMAT COLOR COL_GROUP INTENSIFIED ON.
WRITE:/1 SY-VLINE,
2 wf_object2,
105 SY-VLINE.
endat.
case wa_tadir-object.
when 'SMOD'.
wf_smod = wf_smod + 1.
SELECT SINGLE MODTEXT into wf_txt
FROM MODSAPT
WHERE SPRSL = SY-LANGU
AND NAME = wa_tadir-OBJ_NAME.
FORMAT COLOR COL_NORMAL INTENSIFIED OFF.
when 'SXSD'.
For BADis
wf_badi = wf_badi + 1 .
select single TEXT into wf_txt
from SXS_ATTRT
where sprsl = sy-langu
and EXIT_NAME = wa_tadir-OBJ_NAME.
FORMAT COLOR COL_NORMAL INTENSIFIED ON.
endcase.
WRITE:/1 SY-VLINE,
2 wa_tadir-OBJ_NAME hotspot on,
41 SY-VLINE ,
42 wf_txt,
105 SY-VLINE.
AT END OF object.
write : /(105) sy-ULINE.
ENDAT.
ENDLOOP.
WRITE:/(105) SY-ULINE.
SKIP.
FORMAT COLOR COL_TOTAL INTENSIFIED ON.
WRITE:/ 'No.of Exits:' , wf_smod.
WRITE:/ 'No.of BADis:' , wf_badi.
ELSE.
FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.
WRITE:/(105) 'No userexits or BADis exist'.
ENDIF.
ELSE.
FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.
WRITE:/(105) 'Transaction does not exist'.
ENDIF.
AT LINE-SELECTION.
data : wf_object type tadir-object.
clear wf_object.
GET CURSOR FIELD FIELD1.
CHECK FIELD1(8) EQ 'WA_TADIR'.
read table jtab with key obj_name = sy-lisel+1(20).
move jtab-object to wf_object.
case wf_object.
when 'SMOD'.
SET PARAMETER ID 'MON' FIELD SY-LISEL+1(10).
CALL TRANSACTION 'SMOD' AND SKIP FIRST SCREEN.
when 'SXSD'.
SET PARAMETER ID 'EXN' FIELD SY-LISEL+1(20).
CALL TRANSACTION 'SE18' AND SKIP FIRST SCREEN.
ENDCASE.
Alternatively, you can do the following:
1. For what ever transaction u want the enhancement .. just check for the System-->status (menu) and find out the PROGRAM name....
2. Double click on to the program name and go inside the program (Abap editor)
3. Search for "Call Customer-function " ... and u'll get some search results .. If u get results then u have enhancement in that tcode .....
4. Then it actually calls a Function module .... copy the Function module name .... go to SE80 (object navigator) click on "Repository Information system" then Customer Enhancements .... Give the Function module name in the "Components" field and click Execute ....
ull get a list of Enhancements related to that Componene....
5. Choose which ever enhancement will suit ur business need ..
6. Go to CMOD... create a project .... assign ur enhancement ... and then code ur logic.... activate ur enhancement in CMOD ....... Ur Buisness need will be solved...
For a user exit......
Finding whether there is any User Exit or not for tcode VA42
1. For what ever transaction u want the user exit .. just check for the System-->status (menu) and find out the PROGRAM name.... ( The program name would be for our scenario "SAPMV45A" )
2. Double click on to the program name and go inside the program (Abap editor)
3. Search for the word "USEREXIT" .... u ll find all the user exits in the search result .. and find ur's then ...
Hope this will help.
Regards,
Naveen. -
Opening a related table from tap event.
I have a simple Edit screen called DE_Client which is based on a SQL Table (not a view).
I have a browse screen based on a SQL View of the same table and have related the two elements together.
Using the standard tap event option I have chosen to open the DE_Client screen from the view and expected it would open the related record, but it looks like its now going to be that simple ?
I see that if I use the above and tap the item nothing happens so I expected I would have to add an option to the bottom item, I see that I have an Option (New PATIENT_TABLE) but this just opens a new diaglogue for entry.
Thanks in advance for any assistance you can give on this.Make the edit screen accept the Id or primary key as a parameter, then deal with retrieving the PATIENT_TABLE record in the screen's _created event.
or
Use 'Write my own method' to call 'myapp.showScreen(...'
// retrieve 'patientTable' before showing screen
myapp.showAddEditPATIENT_TABLE(patientTable) // or
myapp.showScreen("AddEditPATIENT_TABLE", null, {
beforeShown: ...
But writing code and doing it this way is not necessary, you can just wire it up in the designer. Less code is better most times. Code could be more efficient though.
Create a custom query on "PATIENT_TABLE" in the server project. Add parameter(s) that you will use for value(s) to pass from a view row (perhaps Id , or the primary key). Filter by the parameters and set the query to return 'Single' not 'Multiple'.
In the browse screen design do "Add Data Item..." and "Query", choose your new custom "PATIENT_TABLE" query. Ok.
Bind the query parameter(s) to the corresponding value(s) in the selectedItem of the visual collection of the 'view'.
Now when setting up the item_tap you have a "PATIENT_TABLE" to pass in as the parameter.
Cheers
Dave
Dave Baker | AIDE for LightSwitch | Xpert360 blog | twitter : @xpert360 | Xpert360 website | Opinions are my own. For better forums, remember to mark posts as helpful/answer. -
How can I select all subject related messages from Inbox and Sent folders
L&G,
is there any way to select messages containing the same subject from the Inbox and the Sent folder by means of an keyboard shortcut. I.e. I would like to select a message in the Inbox folder and request Mail to display all related mails.
Thanks in advance for your support.not like this. you can do a subject search inside one mailbox or in all mailboxes at once. you can not restrict a search to two mailboxes. even when searching one mailbox you have to enter the search string in the search window. there is no shortcut that will do it for you.
-
Relation between employee data and SAP user ID
Hi experts,
I am searching a relation between a SAP User Id and the personal data of an employee like Infotype 2.
Is there any relation like this?
Thanks!Hi,
The SAP User ID is attached to employee number using communications infotype IT 0105 subtype 0001.
Also e-mail, fax, telephone number are stored in this infotype under different subtypes.
hope this helps
Ajay -
Getting a table from XI to SAP through RFC
Hi Experts,
I created a RFC function to get data from XI.
I created a structure and defined a table in the Tables tab in the function.
When the function is called fron XI, I can see that the function is working, but i get no data in the table.
Any ideas?
Thank you very much,
Sagit.Hi,
The function parameters:
FUNCTION zsd_get_cost_tms_from_xi .
""Local Interface:
*" TABLES
*" IT_COST_TMS STRUCTURE ZSD_COST_TMS_STRUCT OPTIONAL
*" RETURN STRUCTURE BAPIRET2 OPTIONAL
The table a expect to get from XI:
STRUCTURE ZSD_COST_TMS_STRUCT :
VBELN VBELN CHAR 10 0 Sales and Distribution Document Number
ABSTAMP ABSTAMP CHAR 14 0 ABAP Time Stamp
KBETR CHAR11 CHAR 11 0 Character Length 11
ACE_TXT50 ACE_TXT50 CHAR 50 0 Text
ABADRKFLDN ABADRKFLDN CHAR 30 0 Field name for SD interface
Best Regards,
Sagit. -
To export pivot table from excel and save as picture using powershell
I am trying to automate my work by attaching an excel file to email and send it across using powershell . But also, I want to paste the screenshot of pivot table to my email body .
One way to do it is to save only the pivot table as picture format like jpeg or png , then attach this picture to the email body .
I am looking for an powershell script which will save my pivot table as picture format . I am using powershell V1.0
please help .I'm not familiar with PowerShell script, we usually use VBA script within excel.
The following article describes how to export Excel Range to a Picture File and attach it as the email body by VBA code, it might not be the answer you are looking for, but hope it will give you some inspirations.
http://www.jpsoftwaretech.com/export-excel-range-to-a-picture-file/
Also you can post your question to PowerShell forum to get better support.
Best Regards,
Wind Zhang -
Related tables to fetch from PTMW
Hi Gurus
Can you tell me what tables are envolved in PTMW transaction .
We have an issue with the accuracy of data that has been keyed into SAP from timesheets. As a result the staff have to audit the timesheets entered for some drivers in the the period 1 January to 30 June.
Date range and Profit Centre eg TKB655P producing the output of the names of employees with matching records.
They will then be able to go through the filing system to select the appropriate files.
This report is required with some urgency.
Regards
Chrishi
u can find related tables from sql trace
SQT Trace is used to analize the performance of select
queries.Transaction code is ST05.
STEPS:
go to ST05
selet Active mode
select Trace on
select application provide the transaction code in command
line like xk01,xd01 like that
now enter the data in application
again go for ST05
select Inacivemode
Trace off
List Trace
Regards
Sajid -
From XML in CLOB to relational table doubt
versions 11.2.0.2.0 / 10.2.0.4.0
It's a long time, no see since my last dealing with xml and no luck to have an attribute value returned into the relational table.
It's *<IntrBkSttlmAmt Ccy="???">999999</IntrBkSttlmAmt>*
For the rest the below works in both versions but used on an xml having a 10000 <CdtTrfTxInf> on 11g it took 9 seconds and was killed because no answer was produced after 30 minutes on 10g. A colleague using java loaded the relational table in 34 seconds on 10g and produced the relational table on 11g in just 5 seconds.
The 10g version is surviving with no xmldb installed and there are rumors our thinking heads didn't succeed to deactivate it on 11g yet.
Any suggestion concerning alternate ways to produce a relational table from an xmltype located in a clob column of a relational table are welcome
(looking at CLOB in XML to Normal table Best approach? I thought too many xmltable would have to be used)
with
the_data as
(select q'~
<Document xmlns="urn:iso:std:iso:20022:tech:xsd:pacs.008.001.01">
<pacs.008.001.01>
<GrpHdr>
<MsgId>1L1U000JB4UT1FVS</MsgId>
<MsgId>9X9X999XX9XX9XXX</MsgId>
<CreDtTm>YYYY-MM-DDTHH:MI:SS</CreDtTm>
<NbOfTxs>99999</NbOfTxs>
<TtlIntrBkSttlmAmt Ccy="???">9999999</TtlIntrBkSttlmAmt>
<IntrBkSttlmDt>YYYY-MM-DD</IntrBkSttlmDt>
<SttlmInf>
<SttlmMtd>XXXX</SttlmMtd>
<ClrSys>
<ClrSysId>XXXX</ClrSysId>
</ClrSys>
</SttlmInf>
</GrpHdr>
<CdtTrfTxInf>
<PmtId>
<InstrId>XXXXXXX999999-XX999999.XX</InstrId>
<EndToEndId>X9999999999</EndToEndId>
<TxId>X9999-9999999999</TxId>
</PmtId>
<PmtTpInf>
<SvcLvl>
<Cd>XXXX</Cd>
</SvcLvl>
</PmtTpInf>
<IntrBkSttlmAmt Ccy="???">999999</IntrBkSttlmAmt>
<ChrgBr>XXXX</ChrgBr>
<InstgAgt>
<FinInstnId>
<BIC>XXXXXX9X</BIC>
</FinInstnId>
</InstgAgt>
<Dbtr>
<Nm>NAME</Nm>
<PstlAdr>
<AdrLine>ADDRESS</AdrLine>
<AdrLine>CITY</AdrLine>
<Ctry>XX</Ctry>
</PstlAdr>
</Dbtr>
<DbtrAcct>
<Id>
<IBAN>XX99999999999999999</IBAN>
</Id>
</DbtrAcct>
<DbtrAgt>
<FinInstnId>
<BIC>XXXXXX9X</BIC>
</FinInstnId>
</DbtrAgt>
<CdtrAgt>
<FinInstnId>
<BIC>XXXXXX9X</BIC>
</FinInstnId>
</CdtrAgt>
<Cdtr>
<Nm>NAME</Nm>
<PstlAdr>
<AdrLine>ADDRESS</AdrLine>
<AdrLine>CITY</AdrLine>
<Ctry>XX</Ctry>
</PstlAdr>
</Cdtr>
<CdtrAcct>
<Id>
<IBAN>XX99999999999999999</IBAN>
</Id>
</CdtrAcct>
<RmtInf>
<Strd>
<CdtrRefInf>
<CdtrRef>X99999999-9999999999</CdtrRef>
</CdtrRefInf>
<AddtlRmtInf>ADDITIONAL INFO</AddtlRmtInf>
</Strd>
</RmtInf>
</CdtTrfTxInf>
</pacs.008.001.01>
</Document>
~' the_column
from dual
select v.instrid,v.endtoendid,v.txid,v.cd,
v.ccy, /* returned as NULL - the only attribute value */
v.intrbksttlmamt,v.chrgbr,v.bic1,v.nm1,v.adrline11,v.adrline12,v.ctry1,v.iban1,
v.bic2,v.bic3,v.nm2,v.adrline21,v.adrline22,v.ctry2,v.iban2,v.cdtrref,v.addtlrmtinf
from (select xmltype(the_column) the_column_xml
from the_data
) w,
xmltable(xmlnamespaces(default 'urn:iso:std:iso:20022:tech:xsd:pacs.008.001.01'),
'for $r in /Document/pacs.008.001.01/CdtTrfTxInf
return <rw>
<InstrId>{$r/PmtId/InstrId}</InstrId>
<EndToEndId>{$r/PmtId/EndToEndId}</EndToEndId>
<TxId>{$r/PmtId/TxId}</TxId>
<Cd>{$r/PmtTpInf/SvcLvl/Cd}</Cd>
<Ccy>{$r/IntrBkSttlmAmt/@Ccy}</Ccy>
<IntrBkSttlmAmt>{ora:replace($r/IntrBkSttlmAmt,"[.]",",")}</IntrBkSttlmAmt>
<ChrgBr>{$r/ChrgBr}</ChrgBr>
<BIC1>{$r/InstgAgt/FinInstnId}</BIC1>
<Nm1>{$r/Dbtr/Nm}</Nm1>
<AdrLine11>{$r/Dbtr/PstlAdr/AdrLine[1]}</AdrLine11>
<AdrLine12>{$r/Dbtr/PstlAdr/AdrLine[2]}</AdrLine12>
<Ctry1>{$r/Dbtr/PstlAdr/Ctry}</Ctry1>
<IBAN1>{$r/DbtrAcct/Id}</IBAN1>
<BIC2>{$r/DbtrAgt/FinInstnId}</BIC2>
<BIC3>{$r/CdtrAgt/FinInstnId}</BIC3>
<Nm2>{$r/Cdtr/Nm}</Nm2>
<AdrLine21>{$r/Cdtr/PstlAdr/AdrLine[1]}</AdrLine21>
<AdrLine22>{$r/Cdtr/PstlAdr/AdrLine[2]}</AdrLine22>
<Ctry2>{$r/Cdtr/PstlAdr/Ctry}</Ctry2>
<IBAN2>{$r/CdtrAcct/Id}</IBAN2>
<CdtrRef>{$r/RmtInf/Strd/CdtrRefInf/CdtrRef}</CdtrRef>
<AddtlRmtInf>{$r/RmtInf/Strd/AddtlRmtInf}</AddtlRmtInf>
</rw>'
passing w.the_column_xml
columns instrid varchar2(300) path '/rw/InstrId',
endtoendid varchar2(150) path '/rw/EndToEndId',
txid varchar2(200) path '/rw/TxId',
cd varchar2(50) path '/rw/Cd',
ccy varchar2(50) path '/rw/Ccy',
intrbksttlmamt varchar2(50) path '/rw/IntrBkSttlmAmt',
chrgbr varchar2(100) path '/rw/ChrgBr',
bic1 varchar2(100) path '/rw/BIC1',
nm1 varchar2(1000) path '/rw/Nm1',
adrline11 varchar2(1000) path '/rw/AdrLine11',
adrline12 varchar2(1000) path '/rw/AdrLine12',
ctry1 varchar2(50) path '/rw/Ctry1',
iban1 varchar2(200) path '/rw/IBAN1',
bic2 varchar2(100) path '/rw/BIC2',
bic3 varchar2(100) path '/rw/BIC3',
nm2 varchar2(1000) path '/rw/Nm2',
adrline21 varchar2(1000) path '/rw/AdrLine21',
adrline22 varchar2(1000) path '/rw/AdrLine22',
ctry2 varchar2(50) path '/rw/Ctry2',
iban2 varchar2(200) path '/rw/IBAN2',
cdtrref varchar2(1000) path '/rw/CdtrRef',
addtlrmtinf varchar2(1000) path '/rw/AddtlRmtInf'
) vRegards
EtbinHi,
It's a long time, no see since my last dealing with xml and no luck to have an attribute value returned into the relational table.When you use this :
<Ccy>{$r/IntrBkSttlmAmt/@Ccy}</Ccy>That doesn't set the value of the Ccy element with the attribute value, but actually add the attribute Ccy to the element Ccy, which results in
<Ccy Ccy="???"></Ccy>Knowing that, you have three options :
1) Leaving the XQuery as it is and using this instead in the COLUMNS clause :
ccy varchar2(50) path '/rw/Ccy/@Ccy',2) Modifying the XQuery to get the atomic value out of the attribute (using the fn:data function) :
<Ccy>{fn:data($r/IntrBkSttlmAmt/@Ccy)}</Ccy>3) Simplifying the whole thing, something like :
select v.instrid, v.endtoendid, v.txid, v.cd, v.ccy,
replace(v.intrbksttlmamt,'.',',') as intrbksttlmamt, v.chrgbr, v.bic1, v.nm1, v.adrline11, v.adrline12, v.ctry1, v.iban1,
v.bic2, v.bic3, v.nm2, v.adrline21, v.adrline22, v.ctry2, v.iban2, v.cdtrref, v.addtlrmtinf
from the_data w,
xmltable(xmlnamespaces(default 'urn:iso:std:iso:20022:tech:xsd:pacs.008.001.01'),
'/Document/pacs.008.001.01/CdtTrfTxInf'
passing xmltype(w.the_column)
columns instrid varchar2(300) path 'PmtId/InstrId',
endtoendid varchar2(150) path 'PmtId/EndToEndId',
txid varchar2(200) path 'PmtId/TxId',
cd varchar2(50) path 'PmtTpInf/SvcLvl/Cd',
ccy varchar2(50) path 'IntrBkSttlmAmt/@Ccy',
intrbksttlmamt varchar2(50) path 'IntrBkSttlmAmt',
chrgbr varchar2(100) path 'ChrgBr',
bic1 varchar2(100) path 'InstgAgt/FinInstnId',
nm1 varchar2(1000) path 'Dbtr/Nm',
adrline11 varchar2(1000) path 'Dbtr/PstlAdr/AdrLine[1]',
adrline12 varchar2(1000) path 'Dbtr/PstlAdr/AdrLine[2]',
ctry1 varchar2(50) path 'Dbtr/PstlAdr/Ctry',
iban1 varchar2(200) path 'DbtrAcct/Id',
bic2 varchar2(100) path 'DbtrAgt/FinInstnId',
bic3 varchar2(100) path 'CdtrAgt/FinInstnId',
nm2 varchar2(1000) path 'Cdtr/Nm',
adrline21 varchar2(1000) path 'Cdtr/PstlAdr/AdrLine[1]',
adrline22 varchar2(1000) path 'Cdtr/PstlAdr/AdrLine[2]',
ctry2 varchar2(50) path 'Cdtr/PstlAdr/Ctry',
iban2 varchar2(200) path 'CdtrAcct/Id',
cdtrref varchar2(1000) path 'RmtInf/Strd/CdtrRefInf/CdtrRef',
addtlrmtinf varchar2(1000) path 'RmtInf/Strd/AddtlRmtInf'
) vThat last option could possibly get you some performance improvement as well.
Edited by: odie_63 on 14 sept. 2011 20:57 -
Find out the relation from vbrk and ekpo
hi
i want the relation field from vbrk and ekko or ekpo apart from kunnr and lifnr.
ple give me the fieldCheck ThisLink
Relation between the tables ekko and vbrk
Ranga
Maybe you are looking for
-
I have updated the operating system and cannot find how to link my apple tv
How do you close open apps with the new operating system. Used to double click and then tap on open apps and delete them to save using up power?????
-
Where is the Media Folder in your ipod
Thanks for the help although it did lead to another question. You said download the song to my computer and then drag it to my ipod media folder. I've gone to my computer E drive (my ipods there) but I can't find a media folder in the directory.
-
How do you change the light settings in Nokia C3
The light is too bright and I don't know how to change the light settings Help me please!
-
Blank page shows up in the end
Hello All, I've a requirement to add multiple drawings in my form (each on a different page following the previous). It is working fine but it adds a blank page in the end of the drawings. Here is how I've set up my drwaing sub-form Subform tab Type:
-
I have a doubt with applying the index hint to fire for multiple coulmns in a query. For a single column, it is ok like:- select /*+ index( ppbS_inv_sim_serial iss_status) */ item_type_id, status, city from ppbS_inv_sim_serial where status='IT'; ther