Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

SAP Scripts : Can any one help out

Hi

I am modifying the existing script of SD_EXPORT_FUSI. The print program is RVADAUS1. In the form layout at the window of a page, if we go to editor to add some field there I found that it is using structure and its fields. To my surprise, I didnt find any query to fetch data in print program. Could you please help me out.

Further by using the FUSI output type, when I click on print preview I didnt get any info on the page. What may be reason and how to modify it with transparent tables. Shall I write my own Print program.

Thank you

Regards

Bhanu

Tags:
Former Member
Former Member replied

Hi

U need to create a routine where the import parameter is the document number and the output parameter is the customer name, u can't insert any check condtion in your script, because you can't make sure to get the record of VBPA for the customer:

/:   PERFORM GET_NAME IN PROGRAM <ZPROGRAM>
/:   USING &VBRK-VBELN&
/:   CHANGING &NAME&
/:   ENDPERFORM.

FORM GET_NAME TABLES IN_TAB    STRUCTURE ITCSY
                                           OUT_TAB STRUCTURE ITCSY.
  DATA: VBELN  TYPE VBELN,
             KUNNR TYPE KUNNR.

  READ TABLE IN_TAB WITH KEY NAME = 'VBRK-VBELN'.
  IF SY-SUBRC = 0.

   VBELN =  IN_TAB-VALUE.

   CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
       EXPORTING
            INPUT  = VBELN
       IMPORTING
            OUTPUT = VBELN.
  ENDIF.
  
  READ TABLE OUT_TAB WITH KEY NAME = 'NAME'.
  CHECK SY-SUBRC = 0.

  SELECT SINGLE KUNNR INTO KUNNR FROM VBPA
                               WHERE VBELN = VBELN
                                    AND POSNR = '000000'
                                    AND PARVW = 'AG'. 
  SELECT SINGLE NAME1 INTO OUT_TAB-VALUE 
                               WHERE KUNNR = KUNNR.
  IF SY-SUBRC = 0.
    MODIFY OUT_TAB INDEX SY-TABIX.
  ENDIF.
ENDFORM.

Max

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question