04-20-2006 2:53 PM
Hi all,
I want to use a call transaction. It is working (see code below), but I get the list in the print preview and not in the standard view. And I also can not leave this print preview.
For any ideas and solution I'll be very happy.
Thanks,
Fabian
Coding:
data: begin of lt_status occurs 0,
char(2) type c,
end of lt_status.
DATA: bdcdata LIKE bdcdata OCCURS 0 WITH HEADER LINE.
* messages of call transaction
DATA: messtab LIKE bdcmsgcoll OCCURS 0 WITH HEADER LINE.
* error session opened (' ' or 'X')
DATA: e_group_opened.
* message texts
DATA: cupdate LIKE ctu_params-updmode VALUE IS INITIAL.
DATA: ctumode LIKE ctu_params-dismode VALUE 'D'.
DATA: nodata VALUE '/'.
TABLES: t100.
* perfom fpcpl.
perform fpcrpo.
form fpcpl.
perform bdc_dynpro using 'SAPLSSEL' '0100'.
perform bdc_field using 'BDC_CURSOR'
'%%DYN001-LOW'.
perform bdc_field using 'BDC_OKCODE'
'=%026'.
*perform bdc_field using '%%DYN014-LOW'
* ' '.
perform bdc_dynpro using 'SAPLALDB' '3000'.
perform bdc_field using 'BDC_OKCODE'
'=ACPT'.
perform bdc_field using 'BDC_CURSOR'
'RSCSEL-SLOW_I(03)'.
perform bdc_field using 'RSCSEL-SLOW_I(01)'
'01'.
perform bdc_field using 'RSCSEL-SLOW_I(02)'
'02'.
perform bdc_field using 'RSCSEL-SLOW_I(03)'
'03'.
perform bdc_field using 'RSCSEL-SLOW_I(04)'
''.
perform bdc_field using 'RSCSEL-SLOW_I(05)'
''.
perform bdc_field using 'RSCSEL-SLOW_I(06)'
''.
perform bdc_field using 'RSCSEL-SLOW_I(07)'
''.
perform bdc_field using 'RSCSEL-SLOW_I(08)'
''.
perform bdc_dynpro using 'SAPLSSEL' '0100'.
*perform bdc_field using 'BDC_CURSOR'
* '%%DYN014-LOW'.
*perform bdc_field using 'BDC_OKCODE'
* '/00'.
*perform bdc_field using '%%DYN012-LOW'
* '01'.
perform bdc_field using '%%DYN013-LOW'
'DEVUSER'.
*perform bdc_field using '%%DYN014-LOW'
* ''.
*perform bdc_dynpro using 'SAPLSSEL' '0100'.
*perform bdc_field using 'BDC_CURSOR'
* '%%DYN014-LOW'.
perform bdc_field using 'BDC_OKCODE'
'=CRET'.
sy-ucomm = 'CRET'.
perform bdc_transaction using 'FPCPL'.
endform.
FORM bdc_transaction USING tcode.
DATA: l_mstring(480).
DATA: l_subrc LIKE sy-subrc.
* batch input session
* IF SESSION = 'X'.
* CALL FUNCTION 'BDC_INSERT'
* EXPORTING TCODE = TCODE
* TABLES DYNPROTAB = BDCDATA.
* IF SMALLLOG <> 'X'.
* WRITE: / 'BDC_INSERT'(I03),
* TCODE,
* 'returncode:'(I05),
* SY-SUBRC,
* 'RECORD:',
* SY-INDEX.
* ENDIF.
* call transaction using
* ELSE.
REFRESH messtab.
CALL TRANSACTION tcode USING bdcdata
MODE ctumode
UPDATE cupdate
MESSAGES INTO messtab.
* l_subrc = sy-subrc.
* IF smalllog <> 'X'.
* WRITE: / 'CALL_TRANSACTION',
* tcode,
* 'returncode:'(i05),
* l_subrc,
* 'RECORD:',
* sy-index.
endform.
*----------------------------------------------------------------------*
* Start new screen *
*----------------------------------------------------------------------*
FORM bdc_dynpro USING program dynpro.
CLEAR bdcdata.
bdcdata-program = program.
bdcdata-dynpro = dynpro.
bdcdata-dynbegin = 'X'.
APPEND bdcdata.
ENDFORM. "bdc_dynpro
*----------------------------------------------------------------------*
* Insert field *
*----------------------------------------------------------------------*
FORM bdc_field USING fnam fval.
IF fval <> nodata.
CLEAR bdcdata.
bdcdata-fnam = fnam.
bdcdata-fval = fval.
APPEND bdcdata.
ENDIF.
ENDFORM.
04-20-2006 3:19 PM
hello,
T-code is not there in my system, but, from your coding it seems that is a report. If it is a report, then use SUBMIT instead of the Call transaction.
Regards,
Naimesh