2013 Sep 30 4:47 PM
Hello experts,
I am using module function BAPI_DOCUMENT_CREATE2 to create a document (CV01N) when creating a sales order (VA01). As the user needs the document at header level, I have created a new screen 9001 in report SAPLCV130 and a new module function OBJECT_CHECK_VBAK as it was explained in a document I found.
In CV0xN I can see my new tab for the header.
In the user exit SAVE_DOCUMENT I call module function BAPI_DOCUMENT_CREATE2 as follows:
l_doc-documenttype = 'Z54'.
CONCATENATE 'Z54' l_ped INTO l_doc-documentnumber.
l_doc-statusextern = 'LI'.
CLEAR w_obj.
w_obj-objecttype = 'VBAK'.
w_obj-objectkey = vbak-vbeln .
w_obj-documentdirection = 'X'.
APPEND w_obj TO i_obj.
CALL FUNCTION 'BAPI_DOCUMENT_CREATE2'
EXPORTING
documentdata = l_doc
IMPORTING
documenttype = l_type
documentnumber = l_docn
return = i_return
TABLES
characteristicvalues = i_charact
classallocations = i_class
documentdescriptions = i_descr
objectlinks = i_obj
documentstructure = i_doc
documentfiles = i_file
longtexts = i_text.
When I run CV03N form my document (created as Z54<sales order number>) the document is created, but in VA03 there is no link for the document.
Is there any missing thing or is it impossible what I've been asked to do ??
thanks in advance,
María
2013 Sep 30 7:12 PM
Hi Maria Merino,
To help you to find a problem more quicly, use FM BAPI_DOCUMENT_GETDETAIL2 and search any document have a created a link to help a find a problem.
Regards.
2013 Sep 30 7:12 PM
Hi Maria Merino,
To help you to find a problem more quicly, use FM BAPI_DOCUMENT_GETDETAIL2 and search any document have a created a link to help a find a problem.
Regards.
2013 Oct 01 8:00 AM
Hi Rodolfo,
Thanks for your answer but I still have my problem unsolved. I need to get the link to the document in VA02..
Regards,
Maria
2013 Oct 01 8:08 AM
Hola Maria, hasta donde se, la pantalla de la VA03 es sólo para documentos enlazados a la tabla VBAP. Si entras en la VA02 y pruebas a pinchar en Detalles->Documentos, sólo puedes indicar un documento que tenga enlace con VBAP
Una solución puede ser añadir el documento en la pestaña de datos adicionales.
Dear Mary, in standard screens in VA03 or VA02 you can only assign documents linked to VBAP. A solution can be add this funcionality to the additional data screen at header level.
Un saludo
2013 Oct 01 8:08 AM
Hi,
How do you plan to display the link in VA03? like is it by populating another field?
please explain.
If you want to display the link by populating another field, then again u need to use some logic to fetch the link and display.(may be in PBO of 9001 screen for VA03 tcode only)
2013 Oct 01 8:36 AM
Hola Alejandro,
Al principio probé con link a la VBAP y funcionaba correctamente, el problema es que muchas veces crean el pedido sin posiciones, por eso querían link a la VBAK. En el caso de la VBAP no había problema, desde la VA03, Detalles -> documento se accedía al documento.
Pero con la VBAK esto entonces es imposible ?
gracias !!
2013 Oct 01 8:41 AM
Hi Maju,
The user wants to display the link in Extras -> Documents, as it was a link to VBAP. But I think this is not possible..
María
2013 Oct 01 8:43 AM
María, lamentablemente no. Como te dije una posiblidad es añadir un campo en la pestaña de datos adicionales. Otra posibildad es crear una posición de texto en la misma posición, por ejemplo, la posición 1 y linkar a esta posición tus anexos. Poco ortodoxo pero útil.
María, unfortunally there is no a way to link form extras->document to vbak. A possible solution is to include a field in 'additional data' screen at header level, with the document number. Another possibility is to create a text position (TATX position type) always in the same position number, i.e. position numer 1 and link your attachments to this position.
2013 Oct 01 8:53 AM
Hi,
Thanks a lot. I'll check if the user wants a new field in addiontal data screen. I think it's the better solution.
thanks a lot !!