05-23-2014 8:05 AM
Hi,
Scenerio - When user will cancel document through vf11, on click of save button there should popup come where user have to put up reason of cancelation.Input reason should save in vbrk table.That could be viewable in respect to generating cancel document no.
Solution:
For this i have added zreason feild in vbrk table, i used FM popup_get_values for populating vbrk-zreason feild. But when i am entering reason, that is not save in vbrk-zreason feild. I am using save_text fm also for saving the reason. But not success.
Please help me with complete code.
Regards
Ranjeet
05-23-2014 8:16 AM
Provide the enhancement name used. check the VBRK export/changing parameters are filled properly?
05-23-2014 10:03 AM
Hi,
I am implementing following code in fm : RV_INVOICE_DOCUMENT_ADD
DATA: V_BNAME TYPE VBRK-ZREASON.
data: ITAB LIKE SVAL OCCURS 0 WITH HEADER LINE.
DATA: RC TYPE C.
if sy-tcode = 'VF11' AND SY-UCOMM = 'SICH' .
CALL FUNCTION 'POPUP_GET_VALUES'
EXPORTING
* NO_VALUE_CHECK = ' '
POPUP_TITLE = 'REASON OF REJECTION'
* START_COLUMN = '5'
* START_ROW = '5'
* IMPORTING
* RETURNCODE =
TABLES
FIELDS = ITAB.
* EXCEPTIONS
* ERROR_IN_FIELDS = 1
* OTHERS = 2
.
IF SY-SUBRC <> 0.
* Implement suitable error handling here
ENDIF.
ENDIF.
* .
*
IF RC NE 'A'.
READ TABLE ITAB INDEX 1. "BNAME
V_BNAME = ITAB-VALUE.
DATA: IT_TLINES LIKE TLINE OCCURS 0 WITH HEADER LINE.
*
**Lets assume you have the text to be saved in the internal table IT_TEXT.
*
*
*
data : x_header TYPE thead.
*to populate the data into SAVE_TEXT,you should know the values for the below fields.
x_header-tdobject = 'VBBK'.
x_header-tdname = VBRK-ZREASON.
x_header-tdid = '0001'.
x_header-tdspras = sy-langu.
LOOP AT ITAB. .
IT_TLINES-TDFORMAT = '*'.
IT_TLINES-TDLINE = V_BNAME.
APPEND IT_TLINES.
CLEAR IT_TLINES.
ENDLOOP.
* MODIFY vbrk vbrk.
CALL FUNCTION 'SAVE_TEXT'
EXPORTING
* CLIENT = SY-MANDT
HEADER = X_HEADER
* INSERT = ' '
SAVEMODE_DIRECT = 'X'
* OWNER_SPECIFIED = ' '
* LOCAL_CAT = ' '
* IMPORTING
* FUNCTION =
* NEWHEADER =
TABLES
LINES = IT_TLINES.
* EXCEPTIONS
* ID = 1
* LANGUAGE = 2
* NAME = 3
* OBJECT = 4
* OTHERS = 5
* .
IF SY-SUBRC <> 0.
WRITE: / 'Successful'.
COMMIT WORK.
* Implement suitable error handling here
ENDIF.
05-23-2014 10:17 AM
The SAVE_TEXT function module won't save your text in VBRK table.
Check in your user exit if there are any changing/export parameters for VBRK table type and pass the text to that structure.
05-23-2014 10:26 AM
Actually it is functyion module. I am doing enhancement in RV_INVOICE_DOCUMENT_ADD
function Module . Please follow following link,My requirement is same as mention in link:
http://www.architectsap.com/blog/sap-ecc/how-to-enhance-transaction-in-vf11/
05-23-2014 10:38 AM
As per that document, u need not append VBRK table.
The text will be stored in STXH table. Take help of your functional in creating the text id.
05-23-2014 10:58 AM
Not getting clearly, Can you elaborate in detail, for my issue what would be perfect solution. if possible can you send detail code.
05-23-2014 11:00 AM
Hi All,
I have to do same work as per mention in link. Please help me if any have compete code for my issue.
Regards
Ranjeet
05-23-2014 11:01 AM
Hi All,
I have to do same work as per mention in link. Please help me if any have compete code for my issue.
http://www.architectsap.com/blog/sap-ecc/how-to-enhance-transaction-in-vf11/
Regards
Ranjeet
05-23-2014 11:17 AM
Hi Ranjeet,
As far as I understood, U need to proceed as follows:
1. Ask your SD Functional consultant to create a Header Text for "Reason for Rejection" to appear in VF02.
2. Get the TDOBJECT,TDNAME,TDID,TDSPRAS from functional and fill the THEAD structure of your "SAVE_TEXT" function module in enhancement. (u have already coded it, just pass the correct values)
3. The text you save in your enhancement point will be shown automatically in VF02 (via Text determination procedure done by functional)
05-28-2014 6:31 AM