Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

BAPI_PO_RELEASE

Former Member
0 Likes
3,077

I'm using this bapi to release purchase orders.

When I test it right from SE37 there is no problem. But when I try using it through a BSP (with the same data), it returns sy-subrc = 2 (document doesn't exist) and blocks the document.

What can the problem be?

Thanks in advance.

1 ACCEPTED SOLUTION
Read only

former_member182371
Active Contributor
0 Likes
2,409

Hi,

check you´re using conversion routines

like CONVERSION_EXIT_ALPHA_INPUT

for the po number.

Best regards.

7 REPLIES 7
Read only

former_member182371
Active Contributor
0 Likes
2,411

Hi,

check you´re using conversion routines

like CONVERSION_EXIT_ALPHA_INPUT

for the po number.

Best regards.

Read only

0 Likes
2,410

Thanks for answering.

I've checked the values by debugging. When the bapi is called the data provided are exactly the same I am using for my tests. I've been told it might be because some popup they included in customizing, but I've checked that as well and the customizing takes care that it is skipped:

  • Inicio de modificaición 001

  • Código Nuevo

IF sy-tcode NE lc_ped_compras AND sy-tcode NE lc_ped_servicio.

  • Fin de modificación 001

  • Inicio de modificaición 002

  • Excluir los procesos en fondo

  • y las ejecuciones mediante RFC

  • PPG 08/08/2007. Inicio

  • Excluir programa de carga de pedidos de servicios

  • 'ZMM_P_MM03_CONVER_PEDIDOS_SERV'

  • Inicio modificación SGONZALEZLO 20080716.

DATA: lv_llamada_bsp(1) TYPE c.

IMPORT lv_llamada_bsp FROM MEMORY.

  • Fin modificación SGONZALEZLO 20080716.

  • Código Nuevo

IF sy-batch = 'X' OR

  • Inicio modificación SGONZALEZLO 20080716.

lv_llamada_bsp = 'X' OR

  • Fin modificación SGONZALEZLO 20080716.

sy-uname = 'SAPRFC' OR

sy-uname = 'SAPRFCS' OR

sy-cprog = lc_prog_conver. "PPG 08/08/2007. Fin

ELSE.

  • Fin de modificación 002

CALL FUNCTION 'POPUP_DISPLAY_MESSAGE'

EXPORTING

titel = lv_title

msgid = lv_msg_id_zmm

msgty = lv_succ_msg

msgno = lv_msgno_000.

  • Inicio de modificación 002

  • Código Nuevo

ENDIF.

  • Fin de modificación 002

  • Inicio de modificación 001

  • Código Nuevo

ENDIF.

  • Fin de modificación 001

Do you see something liable to be the problem here?

Thanks again and regards.

Read only

0 Likes
2,410

Hi,

within the bapi BAPI_PO_RELEASE there is an authority check


  AUTHORITY-CHECK OBJECT 'M_EINK_FRG'
    ID 'FRGGR' FIELD ekko-frggr
    ID 'FRGCO' FIELD po_rel_code.

after executing the z bsp application use SU53 transaction to make sure

it is not a question of authorizations

Best regards

Read only

Former Member
0 Likes
2,410

hiii

if you are uploading data from excel sheet then may be it will not have leading zeros in it for a change document number..do it there by making cell as text or you can use following FM

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
        EXPORTING
          input  = w_recno
        IMPORTING
          output = w_recno.

    ls_doc-documentnumber  = w_recno.

regards

twinkal

Read only

Former Member
0 Likes
2,410

Thanks to all for the help so far...

Is there any possibility the problem comes from the bapi being called from a BSP?

I've been trying it out from SE37 and I haven't got that error even once.

Thank you in advance...

Read only

former_member182371
Active Contributor
0 Likes
2,410

Hi,

please do have a look at:

OSS Note 413736 - Problems with BAPI_PO_RELEASE

this Note says:

You release purchase orders with BAPI_PO_RELEASE and the followingproblems occur:

1. Blocks are not cancelled after an error.

2. If the purchase order to be released is blocked by another user, exception DOCUMENT_NOT_FOUND is triggered, by mistake.

Maybe this is the reason but it depends on your release.

Have a look at the oss not just in case.

Best regards.

Read only

0 Likes
2,409

Thank you, Pablo.

This could be in fact the problem. But, do you know what could be the cause of the error? If the error message is not the intended one, the problem will be much more difficult to track...

I've been debugging for several days already, and I can't find a solution. I would really apreciate any hint.

Thanks in advance.