How to tpenqueue/tpdequeue structures
Hello All,
I was able to execute the qsample of Tuxedo. The example works well for me. Now
I want the client to enqueue a request to the Tuxedo server ... but this time
rather than a string, it enqueues a structure. I have written the VIEW FILE for
this structure and also the FIELD HEADER file for this structure. I am also able
to send this structure to the server using the tpinit method and get it back
successfully. But I want to know how to send this structure to the server using
the tpenqueue method and then get it back using tpdequeue method.
I tried the following code but it did not work for me ...
struct Person p = (struct Person ) tpalloc("VIEW", "Person", sizeof(struct
Person));
qctl.flags = TPQREPLYQ;
strcpy(qctl.replyqueue, "RPLYQ");
qctl.flags |= TPQDELIVERYQOS;/* specify delivery quality of service */
qctl.delivery_qos = TPQQOSNONPERSISTENT;
tpenqueue("QSPACE", "STRING", (TPQCTL *)&qctl, (char* )p, 0, 0) == -1)
qctl.flags = TPQWAIT;
tpdequeue("QSPACE", "RPLYQ", (TPQCTL *)&qctl, (char **)&p, &len, TPNOTIME);
printf("The first name of the person is %s\n", p->first_name);
printf("The last name of the person is %s\n", p->sur_name);
printf("The age of the person is %d\n", p->age);
tpfree((char *)p);
tpterm();
return(0);
I got the error message
Failure to dequeue STRING service: TPEDIAGNOSTIC - function failed - check
diagnostic value
Queue manager diagnostic -8
regards,
Abhishek.
thanks to you scott for your reply.
> request to the server using tpinit. Tpinit does not send a request, so
> perhaps that test case was not working either. You will need to use
> tpcall to actually send the request.
Oh sorry for the typo I meant to type tpcall. The example is working
perfectly with tpcall.
but if I try to use queue it doesn't work.
I am attaching the code of my example.... Please have a look at it and
let me know why it doesn't work.
I will be very gratefull for your help.
regards,
Abhishek.
Scott Orshan wrote:
Abhishek,
Do you have TMQFORWARD running, to automatically call your server when a
message is enqueued? That is the only way that a reply will appear on
the reply queue.
If you just want to test /Q, then change your tpdequeue to dequeue from
the STRING queue. You will then read the message that you just enqueued.
If you are using TMQFORWARD, and you are still not seeing a reply,
check the ULOG, and check the failure queue if you have one, in case the
service failed. The standard server that coomes with qsample will not
work with VIEWS, as it tries to run the toupper loop on all of the bytes
of the request, and this will scramble the data.
In your description, you indicated that you successfully sent the
request to the server using tpinit. Tpinit does not send a request, so
perhaps that test case was not working either. You will need to use
tpcall to actually send the request.
Scott Orshan
Abhishek Srivastava wrote:
Hello All,
I was able to execute the qsample of Tuxedo. The example works well
for me. Now I want the client to enqueue a request to the Tuxedo
server ... but this time rather than a string, it enqueues a
structure. I have written the VIEW FILE for this structure and also
the FIELD HEADER file for this structure. I am also able to send this
structure to the server using the tpinit method and get it back
successfully. But I want to know how to send this structure to the
server using the tpenqueue method and then get it back using tpdequeue
method.
I tried the following code but it did not work for me ...
struct Person p = (struct Person ) tpalloc("VIEW", "Person",
sizeof(struct Person));
qctl.flags = TPQREPLYQ;
strcpy(qctl.replyqueue, "RPLYQ");
qctl.flags |= TPQDELIVERYQOS;/* specify delivery quality of service */
qctl.delivery_qos = TPQQOSNONPERSISTENT;
tpenqueue("QSPACE", "STRING", (TPQCTL *)&qctl, (char* )p, 0, 0) == -1)
qctl.flags = TPQWAIT;
tpdequeue("QSPACE", "RPLYQ", (TPQCTL *)&qctl, (char **)&p, &len,
TPNOTIME);
printf("The first name of the person is %s\n", p->first_name);
printf("The last name of the person is %s\n", p->sur_name);
printf("The age of the person is %d\n", p->age);
tpfree((char *)p);
tpterm();
return(0);
I got the error message
Failure to dequeue STRING service: TPEDIAGNOSTIC - function failed -
check diagnostic value
Queue manager diagnostic -8
regards,
Abhishek.
[person_que.tar.gz]
Similar Messages
-
How to create custom structure in smart forms & use them in interface
hi experts....
can anyone tell me how to use custom structure in
form interface (parameters) without creating any structure
in the dictionary.Hi Shrama,
If you want to use the structure in interface. You have to create structure in dictionary.
if you create in form or in report ..they won't recongnize the local structures.
Thanks,
Sunil -
How to populate Tree structure from BAPI while tree grows or shrinks
Hi All
Currently I am populating the tree structure from BAPI based on the HLevel (Hierarchy Level) parameter, but when ever insertion and deletion happens in the tree at any level in the UI and at the same time i am updating these tree node values with HLevel value(example : 1 is first level , 2 is second level, 3 is third level etc) updating successfully& correctly into the BAPI, no issues.
Once it is updated into the BAPI, next time when i refreshed the UI then i am not populating the tree structure correctly from BAPI with updated new nodes based on the HLevel. when tree struture grows or shrinks in the BAPI after updating into BAPI from UI then i am not populating the tree sturcture correctly based on the HLevel value from the BAPI.
Please let me know any sample code how to populate tree structure correctly when tree structure grows or shrinks based on the HLevel value ( Hierarchy Level , for example : 1 is level , 2 is 2nd level , 3 is third level nodes etc)
anybody helps in this regard with sample code on the populating tree tructure then it would be great help to me.
Thanks in advance
Regards
Kalki Reddy
Edited by: KalkiReddy on Nov 29, 2009 3:48 PMBapi output node:
Value | Text | HLevel
01 | A | 1
0101 | AA | 2
010101 | AAA | 3
01010B | AAB | 3
0102 | AB | 2
02 | B | 1
0201 | BA | 2
This code is used to build the tree in wdDoInit method
IE_T_CatalogueNode catalogueNode = wdContext.nodeE_T_Catalogue();
int size = catalogueNode.size();
ICatalogoElement level1elem = null;
for (int i = 0; i < size; i ++)
IE_T_CatalogueElement catalogueElem = catalogueNode.getE_T_CatalogueElementAt(i);
if (catalogueElem.getLevel().equals("1"))
// 1 Livello
level1elem = wdContext.createCatalogoElement();
level1elem.setKATALOGART_CODE(catalogueElem.getKatalogart());
level1elem.setCODEGRUPPE_CODE(catalogueElem.getCodegruppe());
level1elem.setCODE(catalogueElem.getCode());
level1elem.setCODE_DESCR(catalogueElem.getKatalogart_Descr());
level1elem.setDESCR(catalogueElem.getKatalogart_Descr());
wdContext.nodeCatalogo().addElement(level1elem);
for (int j = i + 1; j < size; j ++)
IE_T_CatalogueElement catalogueElem2level =
catalogueNode.getE_T_CatalogueElementAt( j );
String level2 = catalogueElem2level.getLevel();
if (level2.equals("2"))
ICatalogoElement level2elem = level1elem.nodeChild().createCatalogoElement();
level2elem.setKATALOGART_CODE(catalogueElem2level.getKatalogart());
level2elem.setCODEGRUPPE_CODE(catalogueElem2level.getCodegruppe());
level2elem.setCODE(catalogueElem2level.getCode());
level2elem.setCODE_DESCR(catalogueElem2level.getCodegruppe_Descr());
level2elem.setDESCR(catalogueElem2level.getCodegruppe_Descr());
level1elem.nodeChild().addElement(level2elem);
for (int k = j + 1; k < size; k ++)
IE_T_CatalogueElement catalogueElem3level =
catalogueNode.getE_T_CatalogueElementAt( k );
String level3 = catalogueElem3level.getLevel();
if (level3.equals("3"))
ICatalogoElement level3elem = level2elem.nodeChild().createCatalogoElement();
level3elem.setKATALOGART_CODE(catalogueElem3level.getKatalogart());
level3elem.setCODEGRUPPE_CODE(catalogueElem3level.getCodegruppe());
level3elem.setCODE(catalogueElem3level.getCode());
level3elem.setCODE_DESCR(catalogueElem3level.getCode_Descr());
level3elem.setDESCR(catalogueElem3level.getCode_Descr());
level2elem.nodeChild().addElement(level3elem);
Damiano -
How to use the structure in the EXIT_SAPMM06E_013 function module
Hello Experts,
Please guide me how to use the structure defined in function modules under table tab in the driver program for smart form to fetch the data. Please post some sample code if available.
Best Regards,
Sandesh.SreyamshCan you please elaborate little bit more what is the actual requirement?
-
How does the event structure work & ...
How does the event structure work & and how to modify the case example if you want to change the name of the case? I haven't a look at the manual but nothing about event structure is mentioned.
I know how it works.. =P
-
How to create a structure in a method
Hi
Would any please tell me how to delcare a structure in a method which contains a SAP defined structre in it . I have done it in normal ABAP but it not taking that syntax in ABAP objects method . Please tell me syntax for a method .
Thanks
AnitaHello Anita
I assume you tried the statement
DATA: begin of <struct>.
In methods we have to use the following approach:
TYPES: begin of ty_s_struc.
TYPES: field1 TYPE <fieldname>.
TYPES: field2 TYPE <struct-fieldname>.
TYPES: ...
TYPES: end of ty_s_struc.
DATA:
ls_struc TYPE ty_s_struc,
lt_itab TYPE STANDARD TABLE OF ty_s_struc
WITH DEFAULT KEY.
I prefer to place my type definition in the "TYPES section" (see push button "Types" in SE24). However, all types defined within your class are <b>private</b> meaning you cannot use them in the interface of public methods.
Regards
Uwe -
How to define the Structure and FCC parameters for EDI file format.
Hi All,
I have a EDI file(FTP)-->XI-->IDOC
the source file content is as follows
PR H01PHUPS
FH SHP 0.0.5
H1 S0022323
W6 7752508853 D
PT 1Z58R7070341111111
PT 1Z58R7070342222222
PT 1Z58R7070353333333
N1ST ZZ 142222
N3ST 8827 D OLD
N4ST MARCY
N1WH ZZ 2070
N3WH 401 QUALITY
N4WH HARRIS
DTENT20111206
DTSHP201112061754
N9LL BN20700033333333
N9NT
CD CP UPS
IT026
P1GD VN A1111
PD Product ID 1
QTORD000000000000010CA
QTSHP000000000000010CA
AM U 000000000000000000M
AM X 000000000000000000
LTLT 1112811111
AM G 000000000000000000
AM N 000000000000000000
AM TAX000000000000000000
AM SVC000000000000000000
AM COD000000000000000000
ST 00000000100000000010000000000000000000000000008500LB
Can any body share me how to declare the structure in DataType.
The first two characters in each record is constant , so this would be the keyfields right?
ex:- PR,FH,H1,W6,PT,AM,N1,N3,N4......
In Comm channel the FCC parameters
i need to go for fieldFixedLengths?
Thanks&Regards
Sai_SHAHi.
if you need to convert an EDI to XML you need to use an Adapter specific (e.g Seeburger) because PI doesn't support EDI files.
Also if you use a FCC , this configuration is for two level Header and Detail.
Check this.
http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/frameset.htm
Regards
Luis Ortiz -
How to use "Reference Structure" setting in analysis grid item
Hello expert,
in Bex analyzer, how to use "Reference Structure" setting in analysis grid item by example?
Many thanks,The variable needs assigned a value, that's why you're getting prompted. When you execute the statement, it's not executing the variable and exec lines.
Having script output available in a grid would be an enhancement request. -
How to find the structural difference between two tables
Hi all,
How to find the structural difference between two tables .
Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - Production
PL/SQL Release 11.1.0.7.0 - Production
CORE 11.1.0.7.0 Production
TNS for 32-bit Windows: Version 11.1.0.7.0 - Production
NLSRTL Version 11.1.0.7.0 - Production
Thanks,
P Prakashyou could try something similar to this, for each table pair that you want to compare:
SELECT 'TABLE_A has these columns that are not in TABLE_B', DIFF.*
FROM (
SELECT COLUMN_NAME, DATA_TYPE, DATA_LENGTH
FROM all_tab_columns
WHERE table_name = 'TABLE_A'
MINUS
SELECT COLUMN_NAME, DATA_TYPE, DATA_LENGTH
FROM all_tab_columns
WHERE table_name = 'TABLE_B'
) DIFF
UNION
SELECT 'TABLE_B has these columns that are not in TABLE_A', DIFF.*
FROM (
SELECT COLUMN_NAME, DATA_TYPE, DATA_LENGTH
FROM all_tab_columns
WHERE table_name = 'TABLE_B'
MINUS
SELECT COLUMN_NAME, DATA_TYPE, DATA_LENGTH
FROM all_tab_columns
WHERE table_name = 'TABLE_A'
) DIFF;that's assuming, column_name, data_type and data_length are all you want to compare on. -
How to use a structure at run time....
Hi gurus,
I am confused on how to use the structure in our report..why do we need it...Please help me with that...
Thanks
Cheers:JimOr you could simply use a structure in your program to group like fields together. So that you could maybe clear them all at one shot.
For example, say that you have a structure with fields a - z.
data: begin of structure,
fielda type c,
fieldb type c,
fieldc type c,
fieldz type c,
end of structure.
So in your program, it is now important for you to clear these fields, if you would have defined them one by one without the structure, you would have to list them all in your CLEAR statement, but instead, since you have them in a structure, you can some say.... CLEAR STRUCTURE.
Regards,
Rich Heilman -
Regarding how to create organization structure in sap workflow
hi Guru's
i am new for wokflow i dont no how to create organization structure.
pl any body help me
regards
vijayhttp://help.sap.com/saphelp_erp2005/helpdata/ru/05/dfba3692dc635ce10000009b38f839/frameset.htm
-
How to execute two structure type values
How to execute two structure type values for HWC app in SUP 2,2 ? Added is the screenshot, with the structure and values to be executed. Trying in the preview works fine , but how to process in the application ?
Thanks Midhun VP i came across result checker , but still checking if there is any work around without result checker. , Will a HTML view with some Success status work in this scenario .
Correct me if i am wrong, as per my understanding , Result checkers checks the error code return value from BAPI and shows the respective message.
If so, what are the Pros and Cons of using Result checker.
Is it suggested to use Result checker for read only operations applications i,e which does nt involve operations( CUD) -
How to find the structure fields data in database tables?
how to find the structure fields data in database tables?
Your question doesn't appear to be Web Dynpro ABAP related. Please only post questions in this forum if they are directly Web Dynpro ABAP related. There are several other more general ABAP related forums.
-
How to create new structure for SOP?
How to create new structure for SOP? and transfer data for long term planning?
hi dear
For SOP there are two types
1. Standard SOP : this the standard SOP configured by SAP consider the Level by Level planning and planning done for product group .
2. Flexible planning SOP: this option is given, so that Rough planning/SOP planning can be done as per the client requirement.e.g planning structure can be sales orgn., distribution channel, division, plant, material
For configuring the flexible planning SOP follow steps
1. Define info structure in IMG
where u define the characteristic and Key field
2. Set parameters for info structures and key figures
Sales & Operations Planning >Master Data>Set parameters for info structures and key figures
where u define Planning method
Consistent planning
Level-by-level planning
Delta planning
and aggregation type
1. Average calculated
2. Total created
3. No aggregation
3. create Planning type with reference to info structure
Regards
Suresh -
Step by step on how to create organizational structure(plan) for workflow?
Hi Experts,
Can anyone send me a step by step process on how to create organizational structure(plan) for workflow?
Thanks a lot in advance.
Rgds,
TMHi,
You can use the following accessible transactions to process your organizational plan:
Transaction Name of Transaction
PPO5 Change Attributes
PPO6 Display Attributes
PPOCE Create Organization and Staffing
PPOCW Create Organization and Staffing (WF)
PPOME Change Organization and Staffing
PPOMW Change Organization and Staffing (WF)
PPOSE Display Organization and Staffing
PPOSW Display Organization and Staffing (WF)
PP01 Maintain Plan Data (Menu)
PP01_DISP Display Plan Data (Menu)
PP03 Maintain Plan Data (Actions)
PP03 Execute Action Directly
Regards,
Deepa Kulkarni
Maybe you are looking for
-
How can i delete a photo album that has been synced from another computer
I am trying to delete a photo album that I do not need anymore from an iPad 4. But the album has been synced from a computer that I don't have access to anymore. Is there anyway around this ?
-
Licensed Version of Acrobat XI Pro reverted to trial version
I've been using Acrobat XI Professional since June 2013 when it was installed on a new laptop from work. For the past few days I've been getting a popup whenever I open an Acrobat file claiming the trial is almost up. Now I cannot open it at all (unl
-
Toshiba - Satellite Click 2-in-1 13.3 keeps crashing
Hi , I just bought a new Toshiba - Satellite Click 2-in-1 13.3 laptop and have had nothing but problems with it. It keeps crashing for no reason. When in idle mode or running an application? I then get a message saying " No bootable device please res
-
IMac 20in compared to a 15in Powerbook?
Okay, I know this has been a posted in similar forms before, but I need to ask my own question. I have a 12inch, G3 iBook. On Saturday I will be getting a new Mac. I am having a difficult time with this. the 15inch Powerbook appeals to me because it'
-
As of today, my brigthness (F1-F2) and sound (F3-F5) control buttons no longer function. Any ideas? I just ran a software update last night. Could that be a problem? It shouldn't ... Also, when I click "About this Mac" on the Finder menu, the box com