Extracting data via iDoc
Hello,
We have implemented a scenario where data from external systems is transferred to BW (3.2) via Idocs. We have generated the required Idoc-types and Segements to contain that data.
How can we best read the data from those iDocs into the infoproviders? Are there standard ways of doing so?
Regards
Hello,
no there are no standard ways to extract IDOC Informartion.
The only ways I see are:
- use the standard extracotrs!!!
- write your own extractor to read the IDOC information
- use XI in bewtween for transformation from IDOC format to BW format
hope this helps
kind reg.
michael
Similar Messages
-
Error trying to extract data via HFM objects
I've written a program to extract selected data from HFM (version 11.1.1.3.500) using the API objects. The program (shown at the bottom of this post) is failing on the 2nd of the following 2 lines:
oOption = oOptions.Item(HSV_DATAEXTRACT_OPT_SCENARIO_SUBSET)
oOption.CurrentValue = lBudgetScenario
where oOption is a data load/extract object previously initialized and lBudgetScenario is the long internal ID for our budget scenario.
The error is usually "COM Exception was unhandled" with a result code of "0x800456c7", but, mysteriously, even with no code changes, it sometimes throws the error "FileNotFoundException was not handled", where it says that it could not load "interop.HSXServerlib or one of its dependencies". The second error occurs even though HSXServer was previously initialized in the program and used in conjunction with the login.
I've carefully traced through the VB.NET 2010 code and find that all relevant objects are instantiated and variables correctly assigned. It also occurred to me that the data load DLLs might have been updated when the 11.1.1.3.50 and 500 patches were applied. For that reason, I removed the references to those DLLs, deleted the interop files in the debug and release folders and copied the server versions of those DLLs to my PC. I then restored the DLL references in Visual Studio which recreated the interops. However, the error still occurs.
The ID I'm using (changed to generic names in the code below) has appropriate security and, for example, can be used to manually extract data for the same POV via the HFM client.
I've removed irrelevant lines from the code and substituted a phony ID, password, server name and application name. The line with the error is preceded by the comment "THE LINE BELOW IS THE ONE THAT FAILS".
Imports HSVCDATALOADLib.HSV_DATAEXTRACT_OPTION
Module Module1
Public lActualScenario, lBudgetScenario As Long
Public oClient As HSXCLIENTLib.HsxClient
Public oDataLoad As HSVCDATALOADLib.HsvcDataLoad
Public oOptions As HSVCDATALOADLib.IHsvLoadExtractOptions
Public oOption As HSVCDATALOADLib.IHsvLoadExtractOption
Public oSession As HSVSESSIONLib.HsvSession
Public oServer As HSXSERVERLib.HsxServer
Sub Main()
'Create a client object instance, giving access to
'the methods to logon and create an HFM session
oClient = New HSXCLIENTLib.HsxClient
'Create a server object instance, giving access to
'all server-based methods and properties
oServer = oClient.GetServerOnCluster("SERVERNAME")
'Establish login credentials
oClient.SetLogonInfoSSO("", "MYID", "", "MYPASSWORD")
'Open the application, which will initialize the server
'and session instances as well.
oClient.OpenApplication("SERVERNAME", "Financial Management", "APPLICATION", oServer, oSession)
'Instantiate a data load object instance, which will be used to extract data from
'FRS.
oDataLoad = New HSVCDATALOADLib.HsvcDataLoad
oDataLoad.SetSession(oSession)
'Initialize the data load options interface.
oOptions = oDataLoad.ExtractOptions
'Find the internal ID numbers for various scenarios and years.
'These are required for HFM API function calls.
lActualScenario = GetMemberID(DIMENSIONSCENARIO, "Actual")
lBudgetScenario = GetMemberID(DIMENSIONSCENARIO, "Budget")
'Construct file names for open data.
strFileName = "c:\Temp\FEWND_BudgetData.dat"
strLogFileName = "c:\Temp\FEWND_BudgetData.log"
'Extract data for the current open cycle.
ExtractData("Budget", BudgetYear, "Dec", strFileName, strLogFileName)
End Sub
Sub ExtractData(ByVal strScenario As String, ByVal strYear As String, ByVal strPeriod As String, _
ByVal strFileName As String, ByVal strLogFileName As String)
'Populate the Scenario element.
oOption = oOptions.Item(HSV_DATAEXTRACT_OPT_SCENARIO_SUBSET)
If strScenario = "Actual" Then
oOption.CurrentValue = lActualScenario
Else
'THE LINE BELOW IS THE ONE THAT FAILS
oOption.CurrentValue = lBudgetScenario
End If
End Sub
Function GetMemberID(ByVal lDimID As Long, ByVal strMemLabel As String) As Long
Dim oMetaData As HSVMETADATALib.HsvMetadata
oMetaData = oSession.Metadata
oEntityTreeInfo = oMetaData.Dimension(lDimID)
GetMemberID = oEntityTreeInfo.GetItemID(strMemLabel)
End Function
End ModuleI stumbled upon the solution to my problem. The documentation for extracting data via objects defines member ID variables as Longs. In fact, I've always defined such variables as longs in previous object programs and had no problems. It appears that the datal load/extract "option" property of "Currentvalue" is defined as integer. When I changed all of my member ID items (such as the "lBudgetScenario" variable that was the right-side of the failing assignment statement) to be integers, the program worked.
-
Extracting data from iDoc tables
Hi,
I need to extract data from idoc segments from the database tables EDIDC and EDID4 for which the idoc status is 51 and to save all this data in an external file.
For example, I need to check all the iDocs with WPUBON01 base type and if the status is 51 then I have to query the ARTNR field from E1WPB02 segment and to save idoc number and ARTNR in an excel file.
Can anybody help me or give me some example?
Thank you in advance.
IoanSee Below Example code :
TYPE-POOLS: slis.
tables : edid4 , edidc ,edids ,lfa1,teds2.
DATA: t_fieldcatalog TYPE slis_t_fieldcat_alv.
DATA: s_fieldcatalog TYPE slis_fieldcat_alv.
DATA: s_layout TYPE slis_layout_alv.
DATA: text11 LIKE E1EDP02.
DATA: text111 LIKE E1MBXYI.
DATA: s_keyinfo TYPE slis_keyinfo_alv.
DATA: v_repid TYPE syrepid.
DATA: V_MSGNO LIKE T100-MSGNR.
*DATA: V_TEXT(90).
DATA : WA_EDIDS TYPE EDIDS.
data : begin of itab_edids occurs 0,
user like edids-UNAME,
date like edids-CREDAT,
time like edids-cretim,
idoc like edids-docnum,
MESSAGETYPE like edidc-MESTYP,
VENDOR LIKE EDIDC-SNDPRN,
name like lfa1-name1,
icon(1),
EXPAND TYPE C,
end of itab_edids.
data : itab type edid4.
data : begin of itab_edidc occurs 0,
doc_num like edidc-docnum,
MESSAGETYPE like edidc-MESTYP,
IDOCTYPE like edidc-DOCTYP,
PARTNERNUMBER like edidc-RCVPRN,
PARTNERTYPE like edidc-RCVPRT,
MESSAGECODE like edidc-MESCOD,
VENDOR LIKE EDIDC-SNDPRN,
data like edidc-credat,
*include structure edidc.
end of itab_edidc.
data : begin of itab_status occurs 0,
idoc like edids-docnum,
date_stauus like edids-logdat,
status_counter like edids-countr,
staTus like edids-status,
*descrp like teds2-descrp,
DESCRP(70),
ponumber like ekpo-ebeln,
MESS LIKE edidc-MESTYP,
*appdoc like edids-stapa1,
end of itab_status.
data : text like edid4-sdata.
DATA: text1 LIKE E1EDK01.
data : begin of itab_teds1 occurs 0.
include structure teds1.
data end of itab_teds1.
*selection-screen begin of block sb with frame title text-001.
*select-options:
s_rsdat for edidc-CREDAT.
*selection-screen end of block sb.
DATA: f_fieldcatalog TYPE slis_fieldcat_alv.
selection-screen begin of block sb with frame title text-001.
parameters:
p_su radiobutton group gp1,
p_re radiobutton group gp1,
p_al radiobutton group gp1.
select-options:
s_rsdat for edids-creDAT,
s_user for edids-uname.
selection-screen end of block sb.
initialization.
PERFORM INITIALIZATION.
start-of-selection.
PERFORM DATA_RETRIVAL.
PERFORM DATA_BASED_SELECTION.
PERFORM PASSING_ALV.
*select docnum mestyp doctyp rcvprn rcvprt mescod credat into
*table itab_edidc from edidc
*where credat in s_rsdat.
*CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
*EXPORTING
*i_program_name = v_repid
*I_INTERNAL_TABNAME = 'ITAB_STATUS'
*CHANGING
*ct_fieldcat = t_fieldcatalog.
*CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
*EXPORTING
*i_program_name = v_repid
*I_INTERNAL_TABNAME = 'ITAB_EDIDS'
*CHANGING
*ct_fieldcat = t_fieldcatalog.
s_LAYOUT-ZEBRA = 'X'.
*s_LAYOUT-SUBTOTALS_TEXT = 'SUBTOTAL'.
*s_LAYOUT-TOTALS_TEXT = 'TOTAL'.
*& Form INITIALIZATION
text
--> p1 text
<-- p2 text
FORM INITIALIZATION.
V_REPID = SY-REPID.
s_keyinfo-header01 = 'IDOC'.
s_keyinfo-item01 = 'IDOC'.
*s_layout-subtotals_text = 'SUBTOTAL TEXT'.
*s_layout-key_hotspot = 'X'.
*s_layout-expand_fieldname = 'EXPAND'.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = V_REPID
I_INTERNAL_TABNAME = 'ITAB_STATUS'
I_INCLNAME = V_repid
CHANGING
ct_fieldcat = T_fieldcatalog
EXCEPTIONS
INCONSISTENT_INTERFACE = 1
PROGRAM_ERROR = 2
OTHERS = 3.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = V_REPID
I_INTERNAL_TABNAME = 'ITAB_EDIDS'
I_INCLNAME = V_repid
CHANGING
ct_fieldcat = T_fieldcatalog
EXCEPTIONS
INCONSISTENT_INTERFACE = 1
PROGRAM_ERROR = 2
OTHERS = 3.
f_fieldcatalog-just = 'L'.
MODIFY t_fieldcatalog FROM f_fieldcatalog
TRANSPORTING just
WHERE ( fieldname = 'IDOC' OR FIELDNAME = 'STATUS_COUNTER' ).
f_fieldcatalog-SELTEXT_L = 'Status Message'.
MODIFY t_fieldcatalog FROM f_fieldcatalog
TRANSPORTING SELTEXT_L
WHERE fieldname = 'DESCRP'.
f_fieldcatalog-TECH = 'X'.
MODIFY t_fieldcatalog FROM f_fieldcatalog
TRANSPORTING TECH
WHERE fieldname = 'EXPAND'.
f_fieldcatalog-REPTEXT_DDIC = 'Vendor Name'.
MODIFY t_fieldcatalog FROM f_fieldcatalog
TRANSPORTING REPTEXT_DDIC
WHERE fieldname = 'NAME'.
*f_fieldcatalog-REPTEXT_DDIC = 'V Code 32122'.
*MODIFY t_fieldcatalog FROM f_fieldcatalog
*TRANSPORTING REPTEXT_DDIC
*WHERE fieldname = 'VENDOR'.
ENDFORM. " INITIALIZATION
*& Form DATA_RETRIVAL
text
--> p1 text
<-- p2 text
FORM DATA_RETRIVAL.
select uname credat cretim docnum into table
itab_edids from edids
where credat in s_rsdat and
uname in s_user and
countr = ' '.
select uname credat cretim docnum from edids
*APPENDING CORRESPONDING FIELDS OF TABLE itab_edids
where logdat in s_rsdat and
uname in s_user.
SELECT budat hkont belnr shkzg wrbtr FROM bsas
*APPENDING CORRESPONDING FIELDS OF TABLE it_temp WHERE hkont = w_glacct
*"wa_cb-gl_account
*AND bukrs IN (so_bukrs-low)
*AND budat < so_date-low.
delete adjacent duplicates from itab_edids.
if not itab_edids[] is initial.
select docnum mestyp doctyp rcvprn rcvprt mescod SNDPRN credat into
table itab_edidc from edidc for all entries in itab_edids
where docnum = itab_edids-idoc.
endif.
LOOP AT ITAB_edids.
READ TABLE ITAB_EDIDC WITH KEY DOC_NUM = ITAB_EDIDS-IDOC.
itab_edids-messagetype = ITAB_EDIDC-MESSAGETYPE.
itab_edids-VENDOR = ITAB_EDIDC-VENDOR.
MODIFY ITAB_EDIDS.
CLEAR ITAB_EDIDS.
ENDLOOP.
DELETE ITAB_EDIDC WHERE MESSAGETYPE = 'ORDERS'.
loop at itab_edids.
read table itab_edidc with key doc_num = itab_edids-idoc.
if sy-subrc ne 0.
delete itab_edids.
endif.
endloop.
select docnum logdat countr status into table itab_status from edids for
all entries in itab_edidc where docnum = itab_edidc-doc_num.
LOOP AT ITAB_STATUS.
READ TABLE ITAB_EDIDC WITH KEY DOC_NUM = ITAB_STATUS-IDOC.
ITAB_STATUS-MESS = ITAB_EDIDC-MESSAGETYPE.
MODIFY ITAB_STATUS.
CLEAR ITAB_STATUS.
ENDLOOP.
loop at itab_status.
clear : text ,text1 , text11, text111, itab.
select single descrp from teds2 into itab_status-descrp
where status = itab_status-STATUS AND
LANGUA = 'E'.
select single sdata into text from edid4 where
DOCNUM = itab_status-idoc and
segnam = 'E1EDK01'.
*MOVE: text TO text1,
text1-BELNR TO itab_status-ponumber.
itab_status-ponumber = text1-belnr.
move text+83(30) to itab_status-ponumber.
MODIFY ITAB_STATUS.
clear itab_status.
IF itab_status-MESS = 'WMMBXY'.
select single * from edid4 INTO ITAB where segnam = 'E1MBXYI' AND
HLEVEL = '02' AND DOCNUM = itab_status-idoc.
MOVE : ITAB-SDATA TO TEXT111 ,
text111-EBELN TO itab_status-ponumber.
**text1-BELNR TO ponumber.
ELSE.
select single * from edid4 INTO ITAB where segnam = 'E1EDP02' AND
HLEVEL = '03' AND DOCNUM = itab_status-idoc.
MOVE : ITAB-SDATA TO TEXT11 ,
*text1-EBELN TO ponumber.
text11-BELNR TO itab_status-ponumber.
endif.
MODIFY ITAB_STATUS.
clear itab_status.
endloop.
ENDFORM. " DATA_RETRIVAL
*& Form PASSING_ALV
text
--> p1 text
<-- p2 text
FORM PASSING_ALV.
s_LAYOUT-EXPAND_FIELDNAME = 'EXPAND'.
DATA: t_events TYPE slis_t_event.
DATA: s_events LIKE LINE OF t_events.
s_events-form = 'TOP_OF_PAGE'.
s_events-name = 'TOP_OF_PAGE'.
APPEND s_events TO t_events.
s_layout-lights_fieldname = 'ICON'.
sort itab_status by status_counter descending. " -
mod3
CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
EXPORTING
i_callback_program = v_repid
is_layout = s_layout
it_fieldcat = t_fieldcatalog
i_callback_user_command = 'USER_COMMAND'
i_tabname_header = 'ITAB_EDIDS'
i_tabname_item = 'ITAB_STATUS'
IT_EVENTS = t_events
is_keyinfo = s_keyinfo
TABLES
t_outtab_header = itab_EDIDS
t_outtab_item = itab_STATUS
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. " PASSING_ALV
*& Form DATA_BASED_SELECTION
text
--> p1 text
<-- p2 text
FORM DATA_BASED_SELECTION.
if p_su eq 'X'.
*loop at itab_status where status = '53'.
*select single stapa1 from edids into itab_status-appdoc
where docnum = itab_status-idoc and status = '53'.
*delete itab_status where status ne '53'.
*modify itab_status.
*endloop.
delete itab_status where status ne '53'.
loop at itab_edids.
read table itab_status with key idoc = itab_edids-idoc binary search.
if sy-subrc ne 0.
delete itab_edids.
ELSE.
*SHIFT ITAB_EDIDS-IDOC LEFT DELETING LEADING '0'.
MODIFY ITAB_EDIDS.
endif.
endloop.
LOOP AT ITAB_STATUS WHERE MESS NE 'WMMBXY'.
SELECT SINGLE * FROM EDIDS INTO WA_EDIDS WHERE DOCNUM = ITAB_STATUS-IDOC
AND COUNTR = ITAB_STATUS-STATUS_COUNTER.
IF WA_EDIDS-STATXT CA '&'.
V_MSGNO = WA_EDIDS-STAMNO.
IF V_MSGNO NE '000'. "----mod3
CALL FUNCTION 'MESSAGE_PREPARE'
EXPORTING
msg_id = WA_EDIDS-STAMID
msg_no = V_MSGNO
MSG_VAR1 = wa_edids-stapa1
MSG_VAR2 = WA_EDIDS-STAPA2
MSG_VAR3 = WA_EDIDS-STAPA3
MSG_VAR4 = WA_EDIDS-STAPA4
IMPORTING
MSG_TEXT = itab_status-descrp.
CONDENSE ITAB_STATUS-DESCRP.
ENDIF."---- mod3
ELSE .
ITAB_STATUS-DESCRP = WA_EDIDS-STATXT.
ENDIF.
*SHIFT ITAB_STATUS-IDOC LEFT DELETING LEADING '0'.
*SHIFT ITAB_STATUS-STATUS_COUNTER LEFT DELETING LEADING '0'.
MODIFY ITAB_STATUS.
ENDLOOP.
LOOP AT ITAB_STATUS WHERE MESS EQ 'WMMBXY'.
SHIFT ITAB_STATUS-IDOC LEFT DELETING LEADING '0'.
SHIFT ITAB_STATUS-STATUS_COUNTER LEFT DELETING LEADING '0'.
ITAB_STATUS-DESCRP = 'APPLICATION DOCUMENT POSTED'.
MODIFY ITAB_STATUS.
ENDLOOP.
delete adjacent duplicates from itab_edids comparing idoc.
elseif p_re eq 'X'.
loop at itab_status where status = '53'.
delete itab_edids where idoc = itab_status-idoc.
endloop.
loop at itab_status.
read table itab_edids with key idoc = itab_status-idoc binary search.
if sy-subrc ne 0.
delete itab_status.
endif.
endloop.
LOOP AT ITAB_STATUS.
SELECT SINGLE * FROM EDIDS INTO WA_EDIDS WHERE DOCNUM = ITAB_STATUS-IDOC
AND COUNTR = ITAB_STATUS-STATUS_COUNTER.
IF WA_EDIDS-STATXT CA '&'.
V_MSGNO = WA_EDIDS-STAMNO.
IF V_MSGNO NE '000'. "----mod3
CALL FUNCTION 'MESSAGE_PREPARE'
EXPORTING
msg_id = WA_EDIDS-STAMID
msg_no = V_MSGNO
MSG_VAR1 = WA_EDIDS-STAPA1
MSG_VAR2 = WA_EDIDS-STAPA2
MSG_VAR3 = WA_EDIDS-STAPA3
MSG_VAR4 = WA_EDIDS-STAPA4
IMPORTING
MSG_TEXT = itab_status-descrp.
CONDENSE ITAB_STATUS-DESCRP.
endif. "-----mod3
ELSE .
ITAB_STATUS-DESCRP = WA_EDIDS-STATXT.
ENDIF.
SHIFT ITAB_STATUS-IDOC LEFT DELETING LEADING '0'.
SHIFT ITAB_STATUS-STATUS_COUNTER LEFT DELETING LEADING '0'.
MODIFY ITAB_STATUS.
ENDLOOP.
LOOP AT ITAB_EDIDS.
SHIFT ITAB_EDIDS-IDOC LEFT DELETING LEADING '0'.
MODIFY ITAB_EDIDS.
ENDLOOP.
delete adjacent duplicates from itab_edids comparing idoc.
elseif p_al eq 'X'.
delete adjacent duplicates from itab_edids comparing idoc.
LOOP AT ITAB_STATUS." WHERE MESS NE 'WMMBXY'.
SELECT SINGLE * FROM EDIDS INTO WA_EDIDS WHERE DOCNUM = ITAB_STATUS-IDOC
AND COUNTR = ITAB_STATUS-STATUS_COUNTER.
IF WA_EDIDS-STATXT CA '&'.
V_MSGNO = WA_EDIDS-STAMNO.
IF V_MSGNO NE '000'. "----mod3
CALL FUNCTION 'MESSAGE_PREPARE'
EXPORTING
msg_id = WA_EDIDS-STAMID
msg_no = V_MSGNO
MSG_VAR1 = WA_EDIDS-STAPA1
MSG_VAR2 = WA_EDIDS-STAPA2
MSG_VAR3 = WA_EDIDS-STAPA3
MSG_VAR4 = WA_EDIDS-STAPA4
IMPORTING
MSG_TEXT = itab_status-descrp.
CONDENSE ITAB_STATUS-DESCRP.
endif. "----mod3
ELSE .
ITAB_STATUS-DESCRP = WA_EDIDS-STATXT.
ENDIF.
*SHIFT ITAB_STATUS-IDOC LEFT DELETING LEADING '0'.
*SHIFT ITAB_STATUS-STATUS_COUNTER LEFT DELETING LEADING '0'.
MODIFY ITAB_STATUS.
ENDLOOP.
endif.
LOOP AT ITAB_EDIDS.
if p_su EQ 'X'.
itab_edids-icon = '3'.
elseif p_re eq 'X'.
itab_edids-icon = '1'.
ELSE.
read table itab_sTATUS with key idoc = itab_EDIDS-idoc
STATUS = '53' ."binary search.
IF SY-SUBRC EQ 0.
itab_edids-icon = '3'.
ELSE.
itab_edids-icon = '1'.
ENDIF.
ENDIF.
select single name1 from lfa1 into itab_edids-name where
lifnr = itab_edids-vendor.
SHIFT ITAB_EDIDS-IDOC LEFT DELETING LEADING '0'.
MODIFY ITAB_EDIDS.
clear itab_edids.
ENDLOOP.
loop at itab_status.
SHIFT ITAB_STATUS-IDOC LEFT DELETING LEADING '0'.
SHIFT ITAB_STATUS-STATUS_COUNTER LEFT DELETING LEADING '0'.
if itab_status-descrp is initial.
select single descrp from teds2 into itab_status-descrp
where status = itab_status-STATUS AND
LANGUA = 'E'.
endif.
MODIFY ITAB_STATUS.
clear itab_status.
endloop.
sort itab_status by idoc.
sort itab_edids by idoc.
ENDFORM. " DATA_BASED_SELECTION
*& Form TOP_OF_PAGE
text
FORM TOP_OF_PAGE.
SKIP.
ULINE.
IF P_SU EQ 'X'.
WRITE : / 'TITLE : SUCCESSFULLY POSTED IDOC', 50 'DATE :', SY-DATUM..
ELSEIF P_RE EQ 'X'.
WRITE : / 'TITLE : REJECTED IDOCS' ,50 'DATE :', SY-DATUM.
ELSEIF P_AL EQ 'X'.
WRITE : / 'TITLE : ALL IDOCS' ,50 'DATE :', SY-DATUM.
ENDIF.
WRITE :/9 'Successful-Green light Unsuccessful-Red Light'.
format color COL_TOTAL intensified on.
WRITE : / 'NOTE : DOUBLE CLICK TO SEE CORREPONDING IDOC AND PO'.
WRITE :/9 'DOUBLE CLICK IDOC NO ON HEADER LIST'.
WRITE : 'AND PO NUMBER ON DETAIL LIST'.
format color off.
ULINE.
SKIP.
ENDFORM. "TOP_OF_PAGE
FORM user_command *
--> UCOMM *
--> SELFIELD *
FORM user_command USING ucomm LIKE sy-ucomm
selfield TYPE slis_selfield.
DATA: WA_IDOC9 LIKE EDIDC-DOCNUM.
DATA: SELTAB TYPE TABLE OF RSPARAMS,
SELTAB_WA LIKE LINE OF SELTAB.
RANGES : R_DATE FOR EDIDC-CREDAT." SY-DATUM.
IF ucomm = '&IC1'.
if SELFIELD-SEL_TAB_FIELD = 'ITAB_EDIDS-IDOC'.
READ TABLE itab_edids INDEX selfield-tabindex.
IF sy-subrc = 0.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = ITAB_edids-IDOC
IMPORTING
OUTPUT = WA_IDOC9.
*r_date-low = itab_edids-date.
*r_date-high = itab_edids-date.
*r_date-SIGN = 'I'.
*r_date-OPTION = 'BT'.
*append r_date.
SUBMIT RSEIDOC2 WITH DOCNUM = wa_idoc9
WITH CREDAT in R_DATE[] AND RETURN.
ENDIF.
ELSEIF SELFIELD-SEL_TAB_FIELD = 'ITAB_STATUS-PONUMBER'.
READ TABLE itab_STATUS INDEX selfield-tabindex.
IF sy-subrc = 0.
SET PARAMETER ID 'BES' FIELD itab_sTATUS-PONUMBER.
CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.
ENDIF.
ENDIF.
ENDIF.
ENDFORM.. -
How to extract data via webservices and configure webservices in BI 7
Hi to all,
Can any body tell me How to extract data via webservices and configure webservices in BI 7.
i have created a remote functionmodule which extract data from R/3 , now i want to upload data to BI 7 using that remote function module.
i have use webservice (push) as adapter mode, as i want to connect function module with SOAP , via web services.
please can any body tell how to do that.
also how to configure the webserive , what is it .
I SHALL BE THANKFULL TO YOU FOR THAT
Regards
Pavneet ranaHi,
1. Using the function library (transaction SE37), call the Web service creation wizard.
To do this, select the desired function module in the function library and choose Utilities ®Generate Web Service ® From the Function Module.
2. Go through the following steps, shown in the wizard:
a. Create a virtual interface.
The virtual interface represents the interface between the Web Service and the outside.
b. Choose the end point.
The name of the function module that is to be offered as Web service is already entered here.
c. Create the Web service definition.
The Web service definition helps with assigning the Web service features, such as how security can be guaranteed in data transfer.
d. Release the Web service.
The wizard generates the object virtual interface and Web service definition in the object navigator.
The function group that was generated when the XML DataSource was created is not transportable and is thus assigned to a local package. To prevent errors due to transports, make sure that the objects that were generated in the Web service creation wizard are assigned to a local non-transportable package.
The Web service is released for the SOAP runtime.
3. In the virtual interface for the import parameter DATASOURCE, define the name of the XML DataSource as the fixed value.
A separate function group is generated for each XML DataSource. It makes sense to pre-assign the parameter DATASOURCE with the name of the XML DataSource in the virtual interface of the Web service for which the function group was generated.
If you do not pre-assign the parameter, it will be necessary to transfer the data sent with the appropriate filled DataSource element, for example, by setting the value in the application that implements the Web service.
a. In the object navigator, choose the name of the package in which the Web service was created and choose Enterprise Services ® Web Service Library ® Virtual Interfaces.
b. Choose Change in the context menu for the virtual interface.
c. For the virtual interface, remove the flags exposed and initial and enter the name of the XML DataSource in apostrophes, for example u20196ADATASOURCENAMEu2019.
d. Activate the virtual interface.
Regards,
Marasa. -
Sales/Stock data via IDOC for replenishment
How to capture customer sales and stock data through IDOC for customer replishnment.
We want to see stock update in Tcode WVM4 (w10t --> Logistics --> Retailing --> Sales -->
Replenishment --> Overview > Stock / Sales> WVM4).I am not sure the correct way to resolve this issue.
We have the flat file, which need to be uploadin our sap database table, so we can use it in customer specific replinshment.
I have followed below step to achieve this target.
Process followed:- Idoc Inbound
Step1) Created segemt WE31 based on our file data
step2) Creation of Idoc type we30
step3) Created Msg type we81
step4)Assign Message type to idoc type WE80
what other/new step is required to complete this requirement? We don't need any ALE connection, since we have flat file in out local systemNishant,
This is NOT the way IDOCS are to be used. When you want to communicate between two SAP systems, you recieve a info from a middleware you use IDOCS.
Here if you want you can read the data and call the concerened BAPI, to create the Sales order.
regards,
Ravi
Note : Please mark the helpful answers -
% Wildcard selection - extract data via Query as a Web Service
Hello all,
I am using Query as a Web Service to extract data through to my Xcelsius document. I have a series of charts that display summed data according to user selections within some combo boxes.
Is there any way to send through a wildcard selection, i.e. pass a " like '%' " query string somehow through to the database?
With the query that I have created:
I have a measure value returned
I have 4 filter objects
I have selected the "Prompt" option for each
Within the Data Manager, the prompt fields are assigned to cells which reference the combo box selections
When I build the query, the selections available are many (equal to, not equal to, greater than, greater than or equal to, etc), but there is no 'like' comparison.
Alternatively, is there a way that I can pass the selected parameter values, including " like '%' " if no value is selected within a dropdown, to the original measure calculations within the universe?
I hope this makes sense, let me know if I need to clarify anything. Any help would be very much appreciated.
Cheers,
MarcoVery easy solution - select 'matches pattern' within the filter objects selection when building the query.
Don't know why I didn't try this earlier. -
Want to transfer data via idocs from one R/3 to different R/3
Hi!!
May i hav nay step by step pdf which gives the complete flow of how to transfer idocs from from one R/3 to different R/3.
Though i have the basics steps but some where I m stuck.
Also I have two doubts::
1.Is thr Any relation bw port name and Logical System name?Can they be same.??I hav kept Logical System name as SAPE60 AND PORT name also as SAPE60(in e60) and SAPEI6(in ei6) servers respectively.
2.Should the Logical System names be maintained same in both the servers??
Kindly respond .
Helpful answers will be rewarded points!!!Hi Deepika ,
See the Example scenarios
MASTER DATA TRANSFERMATION BETWEEN 2 DIFF CLIENTS
For this scenario Client 800 is the Sender and 810 is the receiving system
1. Creating Logical Systems
o Login using 800 client
o Go to T. Code SALE
o Expand Sending and Receiving Systems
o Expand Logical Systems
o Click on Define Logical System
o Click on New Entries
o Create STUD_S, STUD_R Logical Systems
o Save and come back
o Assign the STUD_S Logical System to client 800
o Assign the STUD_R Logical System to client 810
2. Creating the RFCs
o Go to T. Code SM59
o Expand R/3 Connections
o Enter RFC Name as STUD_S
o Connection Type as 3
o Language as EN
o Client as 800
o User as SAPUSER
o PWD as abap
o Target host as sap
o Click on Remote logon button to test the RFC
o Enter RFC Name as STUD_R
o Connection Type as 3
o Language as EN
o Client as 800
o User as SATISH
o PWD as abap
o Target host as sap
o Click on Remote logon button to test the RFC
3. Creating the Message Type
o Go to T. Code WE81
o Click on change, continue
o Click on New Entries button
o Give message type as ZBAPI_STUD_MAS and description
o Save and back
4. Creating the Segment
o Go to T. Code WE31
o Give segment name as ZBAPI_STUD_SEG
o Enter Short Text
o Enter the Field Name and Data Element in the text boxes
o Save, continue,
o Click on Edit -> Set Release.
5. Creating the Basic IDOC Object
o Go to T. code WE30
o Give obj. name as ZBAPI_STUD_IDOC
o Click on create
o Select create new radio button, give description and continue
o Select the IDOC obj name and click on create button
o Enter the segment name which is create earlier
o Select the check box if you want to make the segment mandatory
o Enter 1 in minimum number 99999 in maximum number, continue
o Save and back
o Click on Edit -> Set Release
6. Creating Customer Distribution Model
o Go to T. Code BD64
o Click on change and Create model view button
o Enter the short text and Technical name as ZSTUDENT
o Select the model and click on Add Message Type Button
o Give the Sender as STUD_S,
o Receiver as STUD_R,
o Message Type as ZBAPI_STUD_MAS
o Select the model view & click on Environment -> Generate Partner Profiles
o Select Transfer IDOC Immediately and Trigger Immediately radio buttons
o Click on Execute
o You should get a list in green color which means it executed successfully.
o Back to main screen, select the model view
o Click Edit->Model view->Distribute
o Click on continue
o You should get a list saying model view is distributed successfully.
7. Checking the Port
o Go to T. Code WE21
o Expand Transactional RFC
o Find the port from the list which is created using BD64 for STUD_R (Receiving system) RFC Destination.
8. Checking the Partner Profiles.
o Go to T. Code WE20
o Expand Partner Type LS
o Select the Partner profile STUD_R
o Double click on Message Type ZBAPI_STUD_MAS in Outbound parmtrs.
o Check Receiver Port is assigned correctly
o Check the Basic type as your Basic IDOC object.
9. Assigning the Message Type to Basic IDOC Object
o Go to T. Code WE82
o Click on Change & continue, New Entries button
o Give the Message type as ZBAPI_STUD_MAS
o Give Basic Type as ZBAPI_STUD_IDOC
o Release as 46C
o Save and back
10. Creating Inbound Function Module (Posting Program)
o Go to T. Code SE37
o Create a function Module IDOC_INPUT_ZBAPI_STUD_MAS
o Set the Processing type as Remote Enabled Module and mode as start immed, in Attributes Tab.
o Import Parameters
INPUT_METHOD LIKE BDWFAP_PAR-INPUTMETHD
MASS_PROCESSING LIKE BDWFAP_PAR-MASS_PROC
NO_APPLICATION_LOG LIKE SY-DATAR
MASSSAVEINFOS LIKE MASSSAVINF
o Export Parameters
WORKFLOW_RESULT LIKE BDWF_PARAM-RESULT
APPLICATION_VARIABLE LIKE BDWF_PARAM-APPL_VAR
IN_UPDATE_TASK LIKE BDWFAP_PAR-UPDATETASK
CALL_TRANSACTION_DONE LIKE BDWFAP_PAR-CALLTRANS
o Tables
IDOC_CONTRL LIKE EDIDC
IDOC_DATA LIKE EDIDD
IDOC_STATUS LIKE BDIDOCSTAT
RETURN_VARIABLES LIKE BDWFRETVAR
SERIALIZATION_INFO LIKE BDI_SER
o Exceptions
WRONG_FUNCTION_CALLED
o Source Code
DATA: FIRST_TRANC LIKE MARA_UEB-TRANC,
ZBAPI_STUD_SEG like zbapi_stud.
DATA: ZBAPI_STUD LIKE ZBAPI_STUD.
DATA: I_ZBAPI_STUD LIKE ZBAPI_STUD.
DATA: C_TRUE VALUE 'X'.
DATA: C_FALSE VALUE ' '.
DATA: BEGIN OF T_IDOC_ROLLNO OCCURS 0,
DOCNUM LIKE EDIDC-DOCNUM,
ROLLNO LIKE ZBAPI_STUD-ROLLNO,
END OF T_IDOC_ROLLNO.
DEFINE APPEND_RESFIELDS.
PERFORM APPEND_RES_FIELDS TABLES T_MFIELDRES
T_RES_FIELDS
USING &1
COUNTER-D_IND.
END-OF-DEFINITION.
DATA: I_MARA_UEB LIKE MARA_UEB.
DATA: I_ZSTUD_UEB LIKE ZBAPI_STUD.
DATA: I_MAKT_UEB LIKE MAKT_UEB.
DATA: I_MARC_UEB LIKE MARC_UEB.
DATA: I_MARD_UEB LIKE MARD_UEB.
DATA: I_MFHM_UEB LIKE MFHM_UEB.
DATA: I_MARM_UEB LIKE MARM_UEB.
DATA: I_MEAN_UEB LIKE MEA1_UEB.
DATA: I_MBEW_UEB LIKE MBEW_UEB.
DATA: I_STEU_UEB LIKE STEU_UEB.
DATA: I_STEUMM_UEB LIKE STEUMM_UEB.
DATA: I_MLGN_UEB LIKE MLGN_UEB.
DATA: I_MLGT_UEB LIKE MLGT_UEB. " //br010797 neu zu 4.0
DATA: I_MPGD_UEB LIKE MPGD_UEB.
DATA: I_MPOP_UEB LIKE MPOP_UEB.
DATA: I_MVEG_UEB LIKE MVEG_UEB.
DATA: I_MVEU_UEB LIKE MVEU_UEB.
DATA: I_MVKE_UEB LIKE MVKE_UEB.
DATA: I_MPRW_UEB LIKE MPRW_UEB.
DATA: I_LTX1_UEB LIKE LTX1_UEB.
DATA: HELP_MARC_UEB LIKE MARC_UEB.
DATA: T_MARA_UEB LIKE MARA_UEB OCCURS 0.
DATA: T_MAKT_UEB LIKE MAKT_UEB OCCURS 0.
DATA: T_MARC_UEB LIKE MARC_UEB OCCURS 0.
DATA: T_MARD_UEB LIKE MARD_UEB OCCURS 0.
DATA: T_MFHM_UEB LIKE MFHM_UEB OCCURS 0.
DATA: T_MARM_UEB LIKE MARM_UEB OCCURS 0.
DATA: T_MEAN_UEB LIKE MEA1_UEB OCCURS 0.
DATA: T_MBEW_UEB LIKE MBEW_UEB OCCURS 0.
DATA: T_STEU_UEB LIKE STEU_UEB OCCURS 0.
DATA: T_STEUMM_UEB LIKE STEUMM_UEB OCCURS 0.
DATA: T_MLGN_UEB LIKE MLGN_UEB OCCURS 0.
DATA: T_MLGT_UEB LIKE MLGT_UEB OCCURS 0. " //br010797 neu zu 4.0
DATA: T_MPGD_UEB LIKE MPGD_UEB OCCURS 0.
DATA: T_MPOP_UEB LIKE MPOP_UEB OCCURS 0.
DATA: T_MVEG_UEB LIKE MVEG_UEB OCCURS 0.
DATA: T_MVEU_UEB LIKE MVEU_UEB OCCURS 0.
DATA: T_MVKE_UEB LIKE MVKE_UEB OCCURS 0.
DATA: T_MPRW_UEB LIKE MPRW_UEB OCCURS 0.
DATA: T_LTX1_UEB LIKE LTX1_UEB OCCURS 0.
Internal fields/ tables
DATA: FLAG_ERROR_HAPPENED.
DATA: flag_material_exists. "//br210397 zu 4.0 keine Verwendung mehr
DATA: FLAG_EXIT_TO_BE_DONE.
DATA: HELP_TABIX LIKE SY-TABIX.
DATA: HELP_TRANC LIKE MARA_UEB-TRANC.
DATA: HELP_ALAND LIKE STEU_UEB-ALAND.
DATA: HELP_VKORG LIKE MVKE-VKORG.
DATA: HELP_WERKS LIKE T001W-WERKS.
DATA: HELP_LFDNR LIKE STEU_UEB-LFDNR.
DATA: LAST_MARC_TRANC LIKE MARA_UEB-TRANC.
DATA: LAST_MLGN_TRANC LIKE MARA_UEB-TRANC. " //br010797 neu zu 4.0
DATA: LAST_TEXT_TRANC LIKE MARA_UEB-TRANC.
DATA: CURRENT_TABIX LIKE SY-TABIX.
DATA: GENERAL_SUBRC LIKE SY-SUBRC.
DATA: HELP_FACTOR TYPE P DECIMALS 3.
DATA: USER_SEGMENTS LIKE EDIDD OCCURS 0 WITH HEADER LINE. " insert
DATA: CUST_SEGMENT LIKE EDIDD.
DATA: I_MFIELDRES LIKE MFIELDRES.
DATA: I_MERRDAT LIKE MERRDAT.
DATA: I_EDIDD LIKE EDIDD.
" //br neu zu 3.1g
DATA: T_RES_FIELDS LIKE DELFIELDS OCCURS 0 WITH HEADER LINE.
DATA: T_MFIELDRES LIKE MFIELDRES OCCURS 0.
DATA: T_MERRDAT LIKE MERRDAT OCCURS 0.
DATA: T_EDIDD LIKE EDIDD OCCURS 0.
DATA: BEGIN OF t_matnr OCCURS 0, "//br210397 zu 4.0
matnr LIKE mara-matnr, " wird nicht mehr verwendet
END OF t_matnr. "
DATA: BEGIN OF COUNTER,
TRANC LIKE MARA_UEB-TRANC,
D_IND LIKE MARA_UEB-D_IND,
END OF COUNTER.
DATA: BEGIN OF t_idoc_tranc OCCURS 0, " 4.0
docnum LIKE edidc-docnum, "
tranc LIKE mara_ueb-tranc, "
END OF t_idoc_tranc. "
DATA T_IDOC_TRANC LIKE MATIDOCTRANC OCCURS 0 WITH HEADER LINE."
DATA: FLAG_FITS.
DATA: APPLICATION_SUBRC LIKE SY-SUBRC.
DATA FLAG_MUSS_PRUEFEN LIKE SY-DATAR.
DATA MAX_ERRORS LIKE T130S-ANZUM. " 4.0
note 419281
DATA : FLG_MASS.
CLEAR : FLG_MASS.
FIELD-SYMBOLS: . " 4.0
ALE-distribution unity : IDOC status set by locking "note0361838
data: "note0361838
it_dsp_idocstat like bdidocstat "note0361838
occurs 0 with header line. "note0361838
Initialize data - general
REFRESH T_MFIELDRES.
REFRESH T_IDOC_TRANC.
REFRESH T_IDOC_TRANC. "JH/02.02.98/4.0C KPr100004993
REFRESH t_idoc_tranc_segment. " //br 40 : unnötig
REFRESH matnr_tranc. " -"-
REFRESH t_matnr.
COUNTER-TRANC = 1.
COUNTER-D_IND = 1.
REFRESH T_MARA_UEB.
REFRESH T_MAKT_UEB.
REFRESH T_MARC_UEB.
REFRESH T_MARD_UEB.
REFRESH T_MFHM_UEB.
REFRESH T_MARM_UEB.
REFRESH T_MEAN_UEB.
REFRESH T_MBEW_UEB.
REFRESH T_STEU_UEB.
REFRESH T_STEUMM_UEB.
REFRESH T_MLGN_UEB.
REFRESH T_MLGT_UEB. " //br010797 neu zu 4.0
REFRESH T_MPGD_UEB.
REFRESH T_MPOP_UEB.
REFRESH T_MVEG_UEB.
REFRESH T_MVEU_UEB.
REFRESH T_MVKE_UEB.
REFRESH T_MPRW_UEB.
REFRESH VKORG_ALAND.
REFRESH WERKS_ALAND.
CLEAR APPLICATION_SUBRC.
REFRESH T_MERRDAT.
Check if right function is called
READ TABLE IDOC_CONTRL INDEX 1.
IF SY-SUBRC <> 0.
EXIT.
ELSE.
IF IDOC_CONTRL-IDOCTP <> 'ZBAPI_STUD_IDOC'.
RAISE WRONG_FUNCTION_CALLED.
ENDIF.
ENDIF.
LOOP AT IDOC_CONTRL.
Initialize data - per IDOC
t_idoc_tranc-docnum = counter-tranc.
T_IDOC_TRANC-DOCNUM = IDOC_CONTRL-DOCNUM.
T_IDOC_TRANC-FIRST_TRANC_IDOC = COUNTER-TRANC + 2.
APPEND T_IDOC_TRANC.
Select segments which belong to IDOC
REFRESH T_EDIDD.
LOOP AT IDOC_DATA WHERE DOCNUM = IDOC_CONTRL-DOCNUM.
APPEND IDOC_DATA TO T_EDIDD.
ENDLOOP.
BUSINESS TRANSACTION EVENT (header / data) "note0388000
call function 'OPEN_FI_PERFORM_MGV00200_E' "note0388000
exporting "note0388000
idoc_header = idoc_contrl "note0388000
FLG_APPEND_STATUS = 'X' "note0388000
tables "note0388000
(DEL) idoc_data = idoc_data "note0388000 note0418561
idoc_data = t_edidd "note0418561
idoc_status = idoc_status "note0388000
exceptions "note0388000
others = 1. "note0388000
if sy-subrc = 1. "note0388000
continue. "note0388000
endif. "note0388000
Within one IDOC: loop through data segments:
Prepare internal tables for the current material
LOOP AT T_EDIDD INTO IDOC_DATA.
Transform from CoreData to Normal Data if necesary
CASE IDOC_DATA-SEGNAM.
WHEN 'E1MARAC'.
*--COMMENTED BY SATISH
PERFORM MOVE_E1MARAC_TO_E1MARAM USING IDOC_DATA.
WHEN 'E1MAKTC'.
PERFORM MOVE_E1MAKTC_TO_E1MAKTM USING IDOC_DATA.
*--COMMENTES ENDED BY SATISH
WHEN 'ZBAPI_STUD_SEG'.
PERFORM MOVE_E1MARAC_TO_E1MARAM USING IDOC_DATA.
CLEAR I_ZBAPI_STUD.
Second: Move E1MARAC into E1MARAM
I_ZBAPI_STUD = IDOC_DATA-SDATA.
Third: Move E1MARAM back into IDOC-line
IDOC_DATA-SDATA = I_ZBAPI_STUD.
IDOC_DATA-SEGNAM = 'ZBAPI_STUD_SEG'.
ENDCASE.
CURRENT_TABIX = SY-TABIX.
COUNTER-D_IND = COUNTER-D_IND + 1.
COUNTER-TRANC = COUNTER-TRANC + 2.
CASE IDOC_DATA-SEGNAM.
WHEN 'ZBAPI_STUD_SEG'.
Initialize data - per material
COUNTER-D_IND = 1.
FIRST_TRANC = COUNTER-TRANC.
interpret segment
ZBAPI_STUD_SEG = IDOC_DATA-SDATA.
MOVE-CORRESPONDING ZBAPI_STUD TO I_ZSTUD_UEB.
T_IDOC_ROLLNO-DOCNUM = IDOC_CONTRL-DOCNUM.
T_IDOC_ROLLNO-ROLLNO = I_ZSTUD_UEB-ROLLNO.
APPEND T_IDOC_ROLLNO.
ENDCASE.
if not ZBAPI_STUD_SEG is initial.
ZBAPI_STUD-MANDT = ZBAPI_STUD_SEG-MANDT.
ZBAPI_STUD-ROLLNO = ZBAPI_STUD_SEG-ROLLNO.
ZBAPI_STUD-FNAME = ZBAPI_STUD_SEG-FNAME.
ZBAPI_STUD-LNAME = ZBAPI_STUD_SEG-LNAME.
INSERT ZBAPI_STUD FROM ZBAPI_STUD_SEG.
COMMIT WORK.
ENDIF.
*-- ALE ditribution unity : update IDOC status "note03618
LOOP AT it_dsp_idocstat. "note036
LOOP AT IDOC_STATUS WHERE DOCNUM = it_dsp_idocstat. "note036
DELETE idoc_status INDEX sy-tabix. "note036
ENDLOOP. "note036
APPEND it_dsp_idocstat TO idoc_status. "note036
ENDLOOP. "note036
*--GENERATING THE IDOC STATUS
PERFORM HANDLE_ERROR_EXT " //br40
TABLES "
IDOC_CONTRL "
IDOC_STATUS "
RETURN_VARIABLES "
T_MERRDAT "
T_IDOC_TRANC "
T_IDOC_ROLLNO "JH/4.0C/KPr100004993
USING "
GENERAL_SUBRC "
NO_APPLICATION_LOG "
MASSSAVEINFOS "wk/40c
CHANGING "
WORKFLOW_RESULT. "
PERFORM HANDLE_ERROR
TABLES
IDOC_CONTRL
IDOC_STATUS
RETURN_VARIABLES
T_MERRDAT
T_IDOC_ROLLNO "JH/4.0C/KPr100004993
USING
APPLICATION_SUBRC
CHANGING
WORKFLOW_RESULT.
SORT T_IDOC_ROLLNO BY ROLLNO. "note 315124
React on general error
DATA: I_MERRDAT LIKE MERRDAT.
IF GENERAL_SUBRC <> 0.
I_MERRDAT-MSGTY = 'E'.
I_MERRDAT-MSGID = SY-MSGID.
I_MERRDAT-MSGNO = SY-MSGNO.
I_MERRDAT-MSGV1 = SY-MSGV1.
I_MERRDAT-MSGV2 = SY-MSGV2.
I_MERRDAT-MSGV3 = SY-MSGV3.
I_MERRDAT-MSGV4 = SY-MSGV4.
APPEND I_MERRDAT TO T_MERRDAT.
ENDIF.
LOOP AT T_MERRDAT INTO I_MERRDAT
WHERE MSGTY = 'S' "success
OR MSGTY = 'D' "dummy
OR MSGTY = 'I' "Information " //br011097 zu 3.1I
OR MSGTY = 'H' "dummy " 4.0
OR MSGTY = 'W'. "warning
DELETE T_MERRDAT.
ENDLOOP.
ENDLOOP.
ENDLOOP.
ENDFUNCTION.
*& Form handle_error_ext
FORM HANDLE_ERROR_EXT
TABLES
IDOC_CONTRL STRUCTURE EDIDC
IDOC_STATUS STRUCTURE BDIDOCSTAT
RETURN_VARIABLES STRUCTURE BDWFRETVAR
T_MERRDAT STRUCTURE MERRDAT
IDOC_TRANC STRUCTURE MATIDOCTRANC
JH/02.02.98/4.0C KPr100004993 (Anfang)
T_IDOC_ROLLNO STRUCTURE T_IDOC_ROLLNO
JH/02.02.98/4.0C KPr100004993 (Ende)
USING
GENERAL_SUBRC LIKE SY-SUBRC
NO_APPLICATION_LOG LIKE SY-DATAR
MASSSAVEINFOS LIKE MASSSAVINF
CHANGING
WORKFLOW_RESULT LIKE BDWF_PARAM-RESULT.
DATA FLAG_ERROR_HAPPENED.
DATA I_MERRDAT LIKE MERRDAT.
DATA IDOC_INDEX_2_SUBRC LIKE SY-SUBRC.
DATA AL_HANDLES TYPE BAL_T_LOGH. "//br99
SORT T_IDOC_ROLLNO BY ROLLNO. "note 315124
React on general error
IF GENERAL_SUBRC <> 0.
REFRESH T_MERRDAT.
i_merrdat-tranc = 0. " //br261197
READ TABLE IDOC_TRANC INDEX 1. " zu 40b
I_MERRDAT-TRANC = IDOC_TRANC-FIRST_TRANC_IDOC. "
I_MERRDAT-MSGTY = 'E'.
I_MERRDAT-MSGID = SY-MSGID.
I_MERRDAT-MSGNO = SY-MSGNO.
I_MERRDAT-MSGV1 = SY-MSGV1. I_MERRDAT-MSGV2 = SY-MSGV2.
I_MERRDAT-MSGV3 = SY-MSGV3. I_MERRDAT-MSGV4 = SY-MSGV4.
APPEND I_MERRDAT TO T_MERRDAT.
ENDIF.
DATA: C_TRUE,
C_FALSE VALUE 'X'.
If error happened ==> Rollback whole work....
LOOP AT T_MERRDAT INTO I_MERRDAT WHERE MSGTY NA 'SDHWI'.
EXIT.
ENDLOOP.
IF SY-SUBRC = 0.
FLAG_ERROR_HAPPENED = C_TRUE.
ROLLBACK WORK.
ELSE.
FLAG_ERROR_HAPPENED = C_FALSE.
ENDIF.
Set IDOC status
two cases:
single IDOC-processing: ==> error can be written in IDOC status
package processing ==> anononymous "package error" for all IDOCs
READ TABLE IDOC_CONTRL INDEX 2.
IDOC_INDEX_2_SUBRC = SY-SUBRC.
IF SY-SUBRC = 0.
IF 1 = 2. "//br40
MESSAGE E051(B1). "
ENDIF. "
CLEAR I_MERRDAT.
I_MERRDAT-MSGID = 'B1'.
I_MERRDAT-MSGTY = 'E'.
I_MERRDAT-MSGNO = '051'.
ENDIF.
IF IDOC_INDEX_2_SUBRC NE 0 OR FLAG_ERROR_HAPPENED = C_FALSE.
Nur in diesen Fällen wird Application Log geschrieben
Delete all Successes and Dummy records from t_merrdat
DELETE t_merrdat WHERE msgty = 'S' "success " testweise
OR msgty = 'D'. "dummy "
LOOP AT T_MERRDAT INTO I_MERRDAT WHERE MSGTY = 'D'. "
I_MERRDAT-MSGTY = 'S'. "
MODIFY T_MERRDAT FROM I_MERRDAT. "
ENDLOOP. "
ENDIF.
WORKFLOW_RESULT = 0.
LOOP AT IDOC_CONTRL.
Set IDOC status
CLEAR IDOC_STATUS.
IDOC_STATUS-DOCNUM = IDOC_CONTRL-DOCNUM.
IF FLAG_ERROR_HAPPENED = C_FALSE.
Application log
PERFORM WRITE_APPL_LOG TABLES IDOC_TRANC
T_MERRDAT
IDOC_STATUS
USING IDOC_CONTRL
FLAG_ERROR_HAPPENED
NO_APPLICATION_LOG
MASSSAVEINFOS
AL_HANDLES.
idoc_status-status = '53'. "OK!
APPEND idoc_status.
JH/02.02.98/4.0C KPr100004993 (Anfang)
Fill Return variables
CLEAR RETURN_VARIABLES.
RETURN_VARIABLES-DOC_NUMBER = IDOC_CONTRL-DOCNUM.
RETURN_VARIABLES-WF_PARAM = 'Processed_IDOCs'.
APPEND RETURN_VARIABLES.
Verknüpfungseintrag anlegen
READ TABLE T_IDOC_ROLLNO WITH KEY ROLLNO = IDOC_CONTRL-DOCNUM
BINARY SEARCH.
IF SY-SUBRC = 0.
RETURN_VARIABLES-DOC_NUMBER = T_IDOC_ROLLNO-ROLLNO.
RETURN_VARIABLES-WF_PARAM = 'Appl_Objects'.
APPEND RETURN_VARIABLES.
ENDIF.
JH/02.02.98/4.0C KPr100004993 (Ende)
ELSE.
IF IDOC_INDEX_2_SUBRC NE 0.
Application Log
PERFORM WRITE_APPL_LOG TABLES IDOC_TRANC
T_MERRDAT
IDOC_STATUS
USING IDOC_CONTRL
FLAG_ERROR_HAPPENED
NO_APPLICATION_LOG
MASSSAVEINFOS
AL_HANDLES.
ELSE.
IDOC_STATUS-MSGID = I_MERRDAT-MSGID.
IDOC_STATUS-MSGTY = I_MERRDAT-MSGTY.
IDOC_STATUS-MSGNO = I_MERRDAT-MSGNO.
IDOC_STATUS-MSGV1 = I_MERRDAT-MSGV1.
IDOC_STATUS-MSGV2 = I_MERRDAT-MSGV2.
IDOC_STATUS-MSGV3 = I_MERRDAT-MSGV3.
IDOC_STATUS-MSGV4 = I_MERRDAT-MSGV4.
IDOC_STATUS-STATUS = '51'. "ERROR!
APPEND IDOC_STATUS.
ENDIF.
Fill Return variables
CLEAR RETURN_VARIABLES.
RETURN_VARIABLES-DOC_NUMBER = IDOC_CONTRL-DOCNUM.
return_variables-wf_param = c_wf_par_processed_idocs.
RETURN_VARIABLES-WF_PARAM = 'Error_IDOCs'.
APPEND RETURN_VARIABLES.
WORKFLOW_RESULT = 99999.
ENDIF.
APPEND idoc_status.
ENDLOOP.
IF NO_APPLICATION_LOG IS INITIAL.
CALL FUNCTION 'BAL_DB_SAVE' "//br99
EXPORTING
I_IN_UPDATE_TASK = ' '
I_SAVE_ALL = ' '
I_T_LOG_HANDLE = AL_HANDLES.
EXCEPTIONS
LOG_NOT_FOUND = 1
SAVE_NOT_ALLOWED = 2
NUMBERING_ERROR = 3
OTHERS = 4.
CALL FUNCTION 'BAL_GLB_MEMORY_REFRESH' "//br99
EXPORTING
I_AUTHORIZATION =
I_REFRESH_ALL = ' '
I_T_LOGS_TO_BE_REFRESHED = AL_HANDLES.
EXCEPTIONS
NOT_AUTHORIZED = 1
OTHERS = 2
ENDIF.
ENDFORM. " handle_error
Save, check and activate
11. Assigning the Inbound Function Module to Basic Type & Message Type
o Go to T. Code WE57
o Click on change, continue, continue and New Entries Button
o Enter the Module as IDOC_INPUT_ZBAPI_STUD_MAS
o Type as F
o Basic Type as ZBAPI_STUD_IDOC
o Message Type as ZBAPI_STUD_MAS.
o Direction as 2
o Save and back
Now Login in 810 client
12. Assigning the Inbound Function Module in ALE Table
o Go to T. Code BD51
o Click on continue, New Entries button
o Give the Inbound Function Module IDOC_INPUT_ZBAPI_STUD_MAS
o Give Input t. as 0 (zero)
o Save and back
13. Creating Process Code
o Go to T. Code WE42
o Click on Change, New Entries Button
o Give Process Code name as ZSTUD, give Description & Save
o Select Processing with ALE Services Radio button
o Select Processing by Function Module Radio button
o Click the ALE Table (arrow Icon) in Identification
o Give the Function Module Name ZIDOC_INPUT_ZBAPI_STUD_MAS
o Give maximum number of repeats 0
o Save and back, back
o Select the process code from the list & click on Logical Messages Icon
o Give the Message Type as ZBAPI_STUD_MAS
o Save & Back, Save & Back, Save & Back
14. Changing the Customer Distribution model in Receiving system
o Go to T. Code BD64
o Click on change and Create model view button
o Select the model view & click on Environment -> Generate Partner Profiles
o Select Transfer IDOC Immediately and Trigger Immediately radio buttons
o Click on Execute
o You should get a list in green color which means it executed successfully.
15. Assigning the Process Code to Message Type in Receiving System
o Go to T. Code WE20
o Expand Partner Type LS
o Select the Partner Profile STUD_S
o Double click on Message Type ZBAPI_STUD_MAS in Inbound parmtrs.
o Give the Process Code as ZSTUD
o Click on Trigger Immediately Radio button
o Save & Back
o Save & Back
16. Creating the Selection Program (Outbound Program)
Login in client 800.
Go to T. Code SE38
Create a Report Program as ZSTUD_SEND with the following code
REPORT ZSTUD_SEND
NO STANDARD PAGE HEADING.
TABLES: ZBAPI_STUD.
DATA: IT_STUD LIKE ZBAPI_STUD OCCURS 0 WITH HEADER LINE.
SELECTION-SCREEN:BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-H01.
SELECT-OPTIONS: S_ROLLNO FOR ZBAPI_STUD-ROLLNO.
SELECTION-SCREEN SKIP.
SELECTION-SCREEN:BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-H02.
PARAMETERS: P_MESTYP LIKE EDIDC-MESTYP,
P_RCVPRN LIKE TBDLST-LOGSYS.
SELECTION-SCREEN:END OF BLOCK B2.
SELECTION-SCREEN:END OF BLOCK B1.
START-OF-SELECTION.
PERFORM CREATE_STUDENT.
PERFORM CREATE_IDOC.
*& Form CREATE_STUDENT
sending student
FORM CREATE_STUDENT.
SELECT * FROM ZBAPI_STUD
INTO TABLE IT_STUD
WHERE ROLLNO IN S_ROLLNO.
ENDFORM. " CREATE_STUDENT
*& Form CREATE_IDOC
IDOC Creation
FORM CREATE_IDOC.
DATA : IMAS_DATA LIKE EDIDD OCCURS 10 WITH HEADER LINE,
IMAS_CON LIKE EDIDC OCCURS 10 WITH HEADER LINE,
ICOM_CON LIKE EDIDC OCCURS 10 WITH HEADER LINE.
IMAS_CON-RCVPRT = 'LS'.
IMAS_CON-RCVPRN = P_RCVPRN.
IMAS_CON-IDOCTP = 'ZBAPI_STUD_IDOC'.
IMAS_CON-MESTYP = P_MESTYP.
IMAS_CON-DIRECT = 1.
APPEND IMAS_CON.
LOOP AT IT_STUD.
IMAS_DATA-SEGNAM = 'ZBAPI_STUD_SEG'.
IMAS_DATA-SDATA = IT_STUD.
APPEND IMAS_DATA.
ENDLOOP.
CALL FUNCTION 'MASTER_IDOC_DISTRIBUTE'
EXPORTING
MASTER_IDOC_CONTROL = IMAS_CON
OBJ_TYPE = ''
CHNUM = ''
TABLES
COMMUNICATION_IDOC_CONTROL = ICOM_CON
MASTER_IDOC_DATA = IMAS_DATA
EXCEPTIONS
ERROR_IN_IDOC_CONTROL = 1
ERROR_WRITING_IDOC_STATUS = 2
ERROR_IN_IDOC_DATA = 3
SENDING_LOGICAL_SYSTEM_UNKNOWN = 4
OTHERS = 5
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
COMMIT WORK.
LOOP AT ICOM_CON.
WRITE :/ 'IDOC: ', ICOM_CON-DOCNUM, 'CREATED SUCCESSFULLY'.
ENDLOOP.
ENDFORM. " CREATE_IDOC
17. Transferring the student records from 800 to 810 client
Execute Report Program ZSTUD_SEND
Give the Range of Roll Nos to Transfer
Give Message Type as ZBAPI_STUD_MAS
Give Receiver Logical system as STUD_R
Execute
You should get the IDOC Number
Take the IDOC Number and go to T. Code WE05 & Execute
In Outbox you can see the IDOC Status
Select the status record in left side window
Double click on the Status record in right side window
You can see the Control Record, Data Record and Status Records for that IDOC
If the ICON is green and the status code is 3, it means the IDOC is passed to PORT Successfully.
Now Login in 810 client
Go to T. Code WE05 & Execute
You can see the status record in left side window
If the status no is 53 and color is green, it means the IDOC is Posted to Application successfully.
You can see the Log Information by double clicking on the status record in right side window.
Now in left side window, you can see the Control Record, Data Record & Status Record of the IDOC
Now go to T. Code SE16
Give the table name ZBAPI_STUD & press F7
See the contents of the table
The table is updated with the students records transferred from 800 client with our selection program.
Reward if useful
Thanks
Jagadeesh.G -
Error while extracting data via UD Connect
Hi,
Trying for the first time to connect Oracle data base/JDBC connection type via UD connect(we are in BI 7.0).While creating the data source and assigning UD Connect source object in the extraction tab,following error is obtained" UDCADAPTERROR::RSSDK100 ,cannot open connection"
Appreciate if anybody can advice me on this..checked the RFC connection in BW and its working ok.
regards
saviHi Michael, we have JDBC connection tested in TestJDBCPage.jsp and working good, only have problems in Schema for access to tables, but in SQL test using Schema the result is ok.
How we can get Logs for detect the problem in msg : <b>UDCADPTERERROR::RSSDK|200|TABLE:</b>
We apreciate you collaboration, thank you. -
How to extract data from idocs and store to target
I recently started on BODS project, i am really not sure how does teh idocs work.
Is the sap r3 produces Idocs and the bods need to perform the ETL on idocs? or is it the otherway?
Thank you very much for the helpful info.
Kind regards.hi,
Not sure if this helps but give a try
you can create connection from EAS to SAP .. using a plug-in .. if you have access to oracle Support go for [ID 968961.1]
or
below are steps
1. In EASPATH\console, open components.xml in a text editor.
2. Under <PluginList>, enter <Plugin archiveName="SAP" packageName="com.essbase.eas.sap.ui"/> before the closing </PlugIn> tag.
3. Save and close the file.
4. In EASPATH\console\bin, open admincon.lax in a text editor.
5. Search for lax.class.path= and append ;..\lib\sap_client.jar;..\lib \sap_common.jar to the entry. Save and close the file.
6. In EASPATH\server\bin, open adminsvr.lax in a text editor.
7. Search for lax.nl.java.option.additional, and append -DRFC_INI=EASPATH\server\saprfc.ini. Save and close the file.
8. Create a new environment variable, RFC_INI, with a value of EASPATH\server\saprfc.ini
9. Copy librfc.dll andsapjcorfc.dll to EASPATH\server\bin. You may need to obtain these files from SAP.
let me know if it works :) -
Extracting Data via DATAEXPORT command in CalcScript
Hi
I have cube with the following dimensions :-
Accounts - ACC1 , ACC2 , ACC3
Years - 2005 , 2006 , 2007 , 2008 , 2009 , 2010 , 2011 , 2012
Region - R1 , R2 , R3 , R4
Product - P1, P2 , P3
Now these members above are just for examples. I want to export the zero level data for 2005, 2006 , 2007 , 2008 , 2009 , 2010 and I want the output in the following format : -
Acc1,2005,R1,P1,"DATA"
Acc2,2005,R1,P1,"DATA"
Acc3,2005,R1,P1,"DATA"
Acc1,2006,R1,P1,"DATA"
Is it possible to get such an output, I pretty new to essbase, would be great if someone can explain how?
Thanks in advanceassuming you only had those four dimensions, then using dataexport it is not possible, you have to have at least one column that is from a dense dimension. Assuming a report script or jexport cdf, the same is true. You always need to have something that represents the columns.
-
What is the maximum width that can be written?Harold
The default maximum width is 256 data columns - I don't think that includes dimensions that are set to be <ROW dimensions.Unless a new CFG or report command has been added in one of the newer versions, I don't think this value can be changed. I couldn't find anything in the Essbase.cfg documentation.Regards,Jade----------------------------------Jade ColeSenior Business Intelligence ConsultantClarity [email protected]
-
Extract data from SAP and send to external system via Webmethods & IDOC's
Hi,
We need to Extract data from SAP and send to an external system via Webmethods middlewear using IDOCs. I have never used webmethods before and would like to know more about how to implement this scenario. I have used IDOCS in an EDI scenario before but not used it along with WebMethods.
Any pointers would be of great help. ThanksIf you have already ABAP programs /BAPI's in place then try to develop RFC interface and write some back ground programs to scheudl BAPI's and develop scenario but you need to implement error handling , data validation in PI mapping level.
or
take help from ABAPer to design in ABAP like writing Proxy program to pull data and send it PI.
if you are dealing with master data bit risky(correctness) but can be achived using PI. -
How to extract data from BPC InfoCube via ABAP program?
Hi experts!!
I tried to extract data from a BPC InfoCube via ABAP program, but I did'n have succeed.
I used the function 'RSDRI_INFOPROV_READ' to extract data from standard InfoCubes such as '0COPC_C07' and it run OK! However, when I change the InfoCube name to '/CPMB/WAIX8NE' (BPC InfoCube), everything goes wrong...
Is there any difference between extracting data from BPC and standard InfoCubes?
Thank you all!Moderator message - Welcome to SCN.
But please do not cross and duplicate post.
Thread locked.
Rob -
How to extract data from custom made Idoc that is not sent
Hi experts,
Could you please advise if there is a way how to extract data from custom made idoc (it collects a lot of data from different SAP tables)? Please note that this idoc is not sent as target system is not fully maintained.
As by now, we would like to verify - what data is extracted now.
Any help, would be appreciated!Hi,
The fields that are given for each segment have their length given in EDSAPPL table. How you have to map is explained in below example.
Suppose for segment1, EDSAPPL has 3 fields so below are entries
SEGMENT FIELDNAME LENGTH
SEGMENT1 FIELD1 4
SEGMENT1 FIELD2 2
SEGMENT1 FIELD3 2
Data in EDID4 would be as follows
IDOC SEGMENT APPLICATION DATA
12345 SEGMENT1 XYZ R Y
When you are extracting data from these tables into your internal table, mapping has to be as follows:
FIELD1 = APPLICATIONDATA+0(4) to read first 4 characters of this field, because the first 4 characters in this field would belong to FIELD1
Similarly,
FIELD2 = APPLICATIONDATA+4(2).
FIELD3 = APPLICATIONDATA+6(2).
FIELD1 would have XYZ, FIELD2 = R, FIELD3 = Y
This would remain true in all cases. So all you need to do is identify which fields you want to extract, and simply code as above to extract the data from this table.
Hope this was helpful in explaining how to derive the data. -
Transfer of data from APO to ERP via IDOC
Hi,
I know we can transfer the of transactional data(Planned orders) from APO to R/3 is done via CIF.
Suppose if I need to transfer the same via IDOC instead of CIF how can I do it?
Let me know the steps to follow and way to find out how the data got transferred by IDOC?
For e.g. When I have transfer a planned order from APO to ERP, the data should be populated in the IDOC LOIPRO01 on the ERP side.
Cheers,
Simha.Hi,
For a thouht If you want to use that IDOC data to be transfer to an other system from R/3 then let the data flow through CIF and in INBOUND exit wright code to create IDOC.
But Iam not sure whether it works.
Please eloborate requirement.
Regards,
Kishore Reddy.
Maybe you are looking for
-
Low and unclear sound from headphone HP Pavilion G6 2228tu
laptop hp pavillion g6 2228TU OS windows 8 pro 64 bit every thing was working fine.. but from last 2-3 days i faced a problem of low and cracking sound from headphone .. laptop speraker are working fine .. but when I connect headphone to audio port
-
When trying to preview a composition in 3d (like you see when people are doing tutorial videos), whenever I click on the preview (whilst attempting to move the camera around in the scene to preview it), the preview stops (due to clicking the mouse
-
Adjusting the image of a clip / chapter
I'm burning some clips to a DVD. When I look at the clips in the time line, and when I look at the Chapters in the Chapter list, they're all just blank black images, since that's how the clips all start. How do I make a different image be the "face"
-
Hey everyone, My boyfriend bought me an AppleTV for Christmas. I didn't know what it was at first even though I am an avid MacBook and iPhone user. Anyway after getting my head around it all, we rented a movie from the Apple TV on Thursday evening -
-
Can not instal Win7 WLAN Driver for Satellite C660-168
I can't install WLAN driver on my Satellite C660-168 after Windows 7 installing. What's the problem?