cancel
Showing results for 
Search instead for 
Did you mean: 

Standar ws ProjectByPartyQueryResponse_In is not returning any values

former_member218864
Participant
0 Kudos

Hi gurus,

I'm trying to use the standar webservice ProjectByPartyQueryResponse_In in our landscape in order to get all the projects related to the person responsible for the project but the web service is not returning any values.

When I execute the service -using soapui- with the following values (or any other value for that matters):

<PartyID>20000143</PartyID>

<PartyRoleCode>ZA</PartyRoleCode>

The web service always returns :

<Log>

<BusinessDocumentProcessingResultCode>5</BusinessDocumentProcessingResultCode>

<MaximumLogItemSeverityCode>3</MaximumLogItemSeverityCode>

<Item>

<TypeID>002(ECC_SE_COMMON)</TypeID>

<SeverityCode>3</SeverityCode>

<Note>No records returned for ZA 0020000143</Note>

</Item>

</Log>

The party Id exists and also de party role code and there is at least one project that has that party with that role. I'm sure because I use other web service to find a project by id and in the result the project has the <Party> section with those values.

I was looking for solutions, notes, threads in forums with no success, then i decided to debug the webservice and I did find the following line in the webservice code.

SELECT objnr INTO TABLE it_data FROM ihpa

WHERE parvw = role_code AND

parnr = party_id AND

obtyp = 'PDN'.

when that line executes the select always returns 0 values, then I look in the table IHPA using the SE16 without any filter and I found that my records exists!! but the select does not get it. I was wondering why the select is not working and then I filter the data in the SE16 using the same values that the query does

for example:

PARVW= ZA

PARNR = 20000143

OBTYP = PDN

And I was surprised when the SE16 did not found any value even I was seeing in the previous screen with no filters!!!! And I supouse thats why the webservice is not working. I started making filters one by one, for example firts filtering just de PARVW = ZA and works, but when I filter just the PARNR = 20000143 the SE16 can't find any value, just when I put an * at the end of the number the SE16 returns all the values expected, Im guessing that the fields in the database has blanks at the end but this is a standar table and a standar program.

Have any of you had the same problem? is there anything that I can do? does anyone knows if this is an unkown bug? becaus I could'n find any note on the marketplace.

Any help would be appreciated.

Gustavo Balboa

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

You can directly go to Sproxy and test the service over there. See if you can get output in sproxy test.

former_member218864
Participant
0 Kudos

Hi,

Thanks for you response, but I did all that kind of tests, and the problem is not on the way we test, but on the way the program gets the results. Actualy we did something further, our ABAP team made a simple dummy program using the same select with the same parameters and data types and the results were the same, and they found that te problem is in the way the program is coded...

I'm going to create a support ticket to see if SAP can give us some answers.

But, again. Thanks for taking the time to answer.

Gustavo Balboa

Former Member
0 Kudos

I was looking at SAP Proxy code and found that below code convert input value to 10 digt value

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

input = input-project_by_party_query_sync-project_selection_by_party-party_id-value

IMPORTING

output = party_id.

If you input is 20000143 , it will covert to 0020000143.

but if you see the data element I_PARNR for field PARNR, it is 12 character lenght.

thats why when you execute the ES, it doesn't match the record because of the incorrect field length, and same thing for SE16 filtering.

thanks,

Former Member
0 Kudos

You can User BADI too convert your 10 character PARNR to 12 character value.

I looked at the code and BADI is being executed before actual select query, So you can use BADI for inbound processing.

http://help.sap.com/esoa_erp2005_2/helpdata/en/45/619fbbfe111b24e10000000a155369/content.htm

(Business Add-In (BAdI) PRS_SE_PRS_PROJECTPRJPARTYQR is available for this operation)

former_member218864
Participant
0 Kudos

Hi!!

That´s exactly what my ABAP team told me, about the ALPHA conversion, but I wasn't realize that we can use the BADI to make the conversion to 12 char.

Let me talk to my ABAP team and try this aproach to see if that would solve the problem. I will let you know the results soon.

Thank you very much!

Gustavo Balboa.

Former Member
0 Kudos

Have you problem resolved or not?

former_member218864
Participant
0 Kudos

Hi!

The problem were solved but not using the Badi, because the badi only let you change the value of the var party_id and that var is declared as PARNR (of type numeric with length 10), and no mater wat you do the two 00 can´t be removed.

We solved the problem with an enhancement point in the code at the method "party_get_data", look at the beginin and at the end. We just change the type of var used for party_id.. now we use a CHAR one insted the numeric used by the original code.

And we repeat the select...

Thank you very much for the help.

METHOD party_get_data.

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""$"$SE:(1) Class CL_PRS_PROJECTPRJPARTYQR, Method PARTY_GET_DATA, Start A

$$-Start: (1)----

-


$$

ENHANCEMENT 1 ZPARTY_GET_DATA. "active version

DATA : WA_PARNR TYPE I_PARNR.

DATA : WA_CHPAR(10) TYPE C.

ENDENHANCEMENT.

$$-End: (1)----

-


$$

DATA : temp_object_number TYPE ihpa-objnr,

field1 TYPE char50,

field2 TYPE char50,

field_role TYPE char50,

field_party TYPE char50,

st_object_number TYPE TABLE OF bapiprexp.

DATA : it_data TYPE TABLE OF st_data,

wa_data LIKE LINE OF it_data,

itab TYPE TABLE OF st_data,

wa LIKE LINE OF itab,

wa_project_details LIKE LINE OF project_details,

null.

  • Select Object number based on input Party and Role

SELECT objnr INTO TABLE it_data FROM ihpa

WHERE parvw = role_code AND

parnr = party_id AND

obtyp = 'PDN'.

  • Select Project ID based on input Object number

LOOP AT it_data INTO wa_data.

SELECT pspid post1 FROM proj INTO CORRESPONDING FIELDS OF wa_data

WHERE objnr = wa_data-pspid. "#EC CI_NOFIELD

ENDSELECT.

MOVE-CORRESPONDING wa_data TO wa.

APPEND wa TO itab.

ENDLOOP.

IF sy-subrc <> 0.

field_role = cl_wd_utilities=>get_otr_text_by_alias( 'PLM-SE_PRS_XI_PROXY/ROLE_CODE' ) .

field_party = cl_wd_utilities=>get_otr_text_by_alias( 'PLM-SE_PRS_XI_PROXY/PARTY_ID' ) .

CONCATENATE field_role role_code_external INTO field1.

CONCATENATE field_party party_id INTO field2.

MESSAGE e002(ecc_se_common) WITH field1 field2 INTO null.

CALL FUNCTION 'PS_BAPI_MESSAGE_APPEND'

TABLES

return = party_return.

ELSE.

MESSAGE s082(ops_se_prs) INTO null.

CALL FUNCTION 'PS_BAPI_MESSAGE_APPEND'

TABLES

return = party_return.

ENDIF.

LOOP AT itab INTO wa.

MOVE-CORRESPONDING wa TO wa_project_details.

APPEND wa_project_details TO project_details.

ENDLOOP.

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""$"$SE:(2) Class CL_PRS_PROJECTPRJPARTYQR, Method PARTY_GET_DATA, End A

$$-Start: (2)----

-


$$

ENHANCEMENT 2 ZPARTY_GET_DATA. "active version

WA_CHPAR = party_id.

SHIFT WA_CHPAR BY 2 PLACES.

CLEAR party_return.

REFRESH party_return.

SELECT objnr INTO TABLE it_data FROM ihpa

WHERE parvw = role_code AND

parnr = WA_CHPAR AND

obtyp = 'PDN'.

  • Select Project ID based on input Object number

LOOP AT it_data INTO wa_data.

SELECT pspid post1 FROM proj INTO CORRESPONDING FIELDS OF wa_data

WHERE objnr = wa_data-pspid. "#EC CI_NOFIELD

ENDSELECT.

MOVE-CORRESPONDING wa_data TO wa.

APPEND wa TO itab.

ENDLOOP.

IF sy-subrc <> 0.

field_role = cl_wd_utilities=>get_otr_text_by_alias( 'PLM-SE_PRS_XI_PROXY/ROLE_CODE' ) .

field_party = cl_wd_utilities=>get_otr_text_by_alias( 'PLM-SE_PRS_XI_PROXY/PARTY_ID' ) .

CONCATENATE field_role role_code_external INTO field1.

CONCATENATE field_party party_id INTO field2.

MESSAGE e002(ecc_se_common) WITH field1 field2 INTO null.

CALL FUNCTION 'PS_BAPI_MESSAGE_APPEND'

TABLES

return = party_return.

ELSE.

MESSAGE s082(ops_se_prs) INTO null.

CALL FUNCTION 'PS_BAPI_MESSAGE_APPEND'

TABLES

return = party_return.

ENDIF.

LOOP AT itab INTO wa.

MOVE-CORRESPONDING wa TO wa_project_details.

APPEND wa_project_details TO project_details.

ENDLOOP.

ENDENHANCEMENT.

$$-End: (2)----

-


$$

ENDMETHOD.