As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.
Join the TIBCO Community TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.
From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
Request access to the private WebFOCUS User Group (login required) to network with fellow members.
Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.
Hi all, I have this issue: In WebFocus, I create the report which connect to SAP and get value from function module (FM) in SAP. To do this, I created synonym of this FM and passed values ( I get these values from another table) to parameters of this FM. The issue is if these values exist in SAP, I can get the returned value but if these values don't exist in SAP, I got the error message:
(FOC1695) SAP/R3 REQUEST ERROR : Archive handle invalid for access : (FOC1736) SAP/R3 ERROR EXECUTING ABAP4 PROGRAM
And because I have a list of values for these parameters so I do a loop statement to go through the list to get the values from this FM. But just when the FM get the wrong values (non-existed value) for parameters, it will stop running and display that message.
What I need to do is whenever the FM read the wrong values, it can skip these values or just display nothing and jump to the next line to get the next values and process instead of stop running and display message. Please help me out on this issue. Thanks.This message has been edited. Last edited by: hainguyen,
Hi, I had a similar issue some time ago when using the READ_TEXT function module. I don’t think I could get rid of the error at the time. However, the way I solved it was to first check the associated transparent tables e.g. STXH to see if the object existed before I tried to retrieve it with the function module.
Perhaps you could try something similar e.g. there may be transparent tables that will indicate whether the data/text that you are trying to retrieve exists. On Google I saw references to tables like TTXOB and TTXID that may be relevant.
If you can find these transparent tables, then you will first check to see if the value you need is in these tables. If it isn't, then you will skip over the step that calls the function module.
WebFOCUS 8.2.06 mostly Windows Server
Posts: 195 | Location: Johannesburg, South Africa | Registered: September 13, 2008
Then you should definitely use STXH to drive your extract.
You would first read TDNAME from STXH with the WHERE clauses for TDSPRAS, TDOBJECT and TDID. This list would contain only those records where there is text for the READ_TEXT function.
WebFOCUS 8.2.06 mostly Windows Server
Posts: 195 | Location: Johannesburg, South Africa | Registered: September 13, 2008
Hi, I probably can speak better FOCUS than I can English, so if you like you can send me your complete FEX, with the loops etc. as you have them, and I can then show you where you could change it.
My email address is twanette.jurd@infobuild.co.za
WebFOCUS 8.2.06 mostly Windows Server
Posts: 195 | Location: Johannesburg, South Africa | Registered: September 13, 2008
Is this duplicate because I still need to get TDLINE in READ_TEXT ?
Yes, in some way it is. But it is the only way that I could find to solve your original problem - i.e. to not get the error message.
quote:
(FOC1695) SAP/R3 REQUEST ERROR : Archive handle invalid for access : (FOC1736) SAP/R3 ERROR EXECUTING ABAP4 PROGRAM
And because I have a list of values for these parameters so I do a loop statement to go through the list to get the values from this FM. But just when the FM get the wrong values (non-existed value) for parameters, it will stop running and display that message.
Using STXH as a driver has an added benefit in that it has a date to say when long text was last changed. What I did was build a FOCUS database on the WebFOCUS reporting server to store the long text, and I then only updated it with new/changed records, rather than reading all the long text over and over (which can be a little slow if there are a lot of records).
Anyway, my technique would work something along these lines. There may be more efficient ways, but it should give you an idea of what I mean. I can't test the code either, because I don't have access to a SAP system at this stage. So I've just coded "blindly" - you'll need to fix any focus errors ;-)
-* =================================================
-* I think if STXH as an "index" - it only contains entries for which there is long text
-* This just gets you a list of EINE/BT records in STXH, with the dates that they were created and last changed - you could use these for "delta" extracts
-* You won't get any text at this stage
-* I don't know how many InfoRecords you have - but we typically just extracted and held all the data in STXH for the specified TDOBJECT/TDID
DEFINE FILE STXH
STXH_KEY/A19 = EDIT(STXH_TDNAME,'999999999999999999') ;
END
TABLE FILE STXH
IF STXH_TDSPRAS EQ 'E'
IF STXH_TDOBJECT EQ 'EINE'
IF STXH_TDID EQ 'BT'
PRINT
STXH_DFDATE
STXH_TDLDATE
STXH_TDTXTLINES
STXH_KEY
BY STXH_TDNAME
ON TABLE HOLD AS HOLD_STXH_EINE FORMAT FOCUS INDEX STXH_KEY
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE SET ASNAMES ON
END
-RUN
-* =================================================
-* Get the data from EINE / EINA
JOIN CLEAR *
JOIN EINE_MANDT AND EINE_INFNR IN EINE TO EINA_MANDT AND EINA_INFNR IN EINA AS J1
TABLE FILE EINE
IF EINE_INFNR 1111111111 OR 2222222222
PRINT
EINA_MATNR
EINA_INFNR
EINA_LIFNR
COMPUTE STXH_KEY/A19 = EINE_INFNR | EINE_EKORG | EINE_ESOKZ | EINE_WERKS ;
BY EINE_MANDT
BY EINE_INFNR
BY EINE_EKORG
BY EINE_ESOKZ
BY EINE_WERKS
ON TABLE HOLD AS HOLD_EINE_EINA FORMAT ALPHA
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE SET ASNAMES ON
END
-RUN
-* =================================================
-* JOIN your EINA/EINE to STXH hold file, so that you can determine which of your EINE/EINA records have long text
JOIN CLEAR *
JOIN STXH_KEY IN HOLD_EINE_EINA TO STXH_KEY IN HOLD_STXH_EINE AS J1
-* Build a list of inforecords that have long text
TABLE FILE HOLD_EINE_EINA
PRINT STXH_KEY
ON TABLE HOLD AS HOLD_LOOP FORMAT ALPHA
ON TABLE SET HOLDLIST PRINTONLY
END
-RUN
-SET &LOOP_COUNT = &LINES ;
-* =================================================
-* This is where I will store my long text
FILEDEF HOLD_LONGTEXT DISK baseapp/hold_longtext.ftm
-RUN
-* Now loop through these to retrieve your long text - all the long text will be written to a single HOLD file
-REPEAT BOT_LOOP &LOOP_COUNT TIMES
-READ HOLD_LOOP NOCLOSE &STXH_KEY.19.
TABLE FILE READ_TEXT
IF READTEXT6_TDOBJECT EQ 'EINE'
IF READTEXT6_TDNAME EQ &STXH_KEY.QUOTEDSTRING
IF READTEXT6_TDID EQ 'BT'
IF READTEXT6_TDSPRAS EQ 'E'
IF TLINE_TDLINE NE ' '
PRINT
COMPUTE STXH_KEY/A19 = &STXH_KEY.QUOTEDSTRING ;
-* I use this so that I can always maintain the sequence of my text lines for subsequent reports
COMPUTE TEXT_LINE_SEQ/I9 = TEXT_LINE_SEQ + 1 ;
TLINE_TDFORMAT
-* Here I am printing TDLINE - but you may want to create a DEFINE field with CTRANs to get rid of cr/lf characters and tabs - they tend to make a mess
TLINE_TDLINE
ON TABLE HOLD AS baseapp/HOLD_LONGTEXT FORMAT ALPHA
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE SET ASNAMES ON
END
-RUN
-* Any further long text records must be appended to the current file
FILEDEF HOLD_LONGTEXT DISK baseapp/hold_longtext.ftm (APPEND
-RUN
-BOT_LOOP
-* =================================================
-* Now you should have HOLD_LONGTEXT with all of your long text
TABLE FILE HOLD_LONGTEXT
PRINT *
END
-* =================================================
WebFOCUS 8.2.06 mostly Windows Server
Posts: 195 | Location: Johannesburg, South Africa | Registered: September 13, 2008
You rock! I did solve this issue with just LOOP and MORE. It surprised me. But I can't wait to try this solution. You gave me a very detail solution and provide me many ideas for this issue. Thanks a lot, Twanette.This message has been edited. Last edited by: hainguyen,