Skip to Content

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

Proccess after a write Statement

Dear Gurus ,

I want to display a popup window after some abap write commands .

But i want to display it AFTER and not before ...

Can i do it ....

Look my code ..

REPORT YAPALLAGI LINE-SIZE 80 LINE-COUNT 65

NO STANDARD PAGE HEADING.

TABLES: LFA1,T001,YAPAL.

DATA: BEGIN OF ITAB_C OCCURS 0,

AR_MITR(10),

NAME(72),

OCCUPA(66),

DOY(71),

ODOS(35),

ARITH(06) ,

CITY(18),

AFM(66),

AFORA(30),

ORIO_VAL(15),

OLD_VAL(15) ,

VAL_1(15) ,

VAL_2(15) ,

VAL_3(15),

VAL_4(15) ,

VAL_5(15),

V_TXT(200),

VAL_TXT(70),

VAL_TXT2(70),

END OF ITAB_C.

DATA: FIRST_TIME TYPE C.

DATA: V_OLD LIKE YAPAL-V_OLD ,

VV LIKE YAPAL-V_OLD ,

VAL_A LIKE YAPAL-V_NEW ,

VAL_B LIKE YAPAL-V_NEW .

*==========================================================

SELECTION-SCREEN SKIP.

PARAMETERS:

P_APALN LIKE YAPAL-APALN OBLIGATORY,

P_MJAHR LIKE YAPAL-MJAHR DEFAULT SY-DATUM(4) OBLIGATORY,

P_LIFNR LIKE LFA1-LIFNR OBLIGATORY

MATCHCODE OBJECT KRED ,

P_VORIO LIKE YAPAL-VORIO ,

P_AR_MIT LIKE YAPAL-AR_MITR ,

P_VAL_N LIKE YAPAL-VAL_N ,

P_VAL_P LIKE YAPAL-VAL_P ,

P_AFORA LIKE YAPAL-AFORA OBLIGATORY ,

P_DDATE LIKE YAPAL-DDATE OBLIGATORY .

SELECTION-SCREEN SKIP.

SELECTION-SCREEN SKIP.

PARAMETERS: P_CHECK AS CHECKBOX DEFAULT 'X'.

AT SELECTION-SCREEN ON EXIT-COMMAND .

IF FIRST_TIME = 'X'.

PERFORM INFORM.

ENDIF.

*==========================================================

INITIALIZATION.

SELECT MAX( APALN ) INTO P_APALN FROM YAPAL WHERE MJAHR = P_MJAHR .

P_APALN = P_APALN + 1.

*==========================================================

START-OF-SELECTION.

SELECT SINGLE * FROM YAPAL WHERE APALN = P_APALN AND

MJAHR = P_MJAHR .

IF SY-SUBRC = 0.

ITAB_C-AR_MITR = YAPAL-AR_MITR.

ITAB_C-NAME = LFA1-NAME1.

ITAB_C-OCCUPA = LFA1-NAME3.

ITAB_C-DOY = LFA1-NAME4.

ITAB_C-ODOS = LFA1-STRAS.

ITAB_C-ARITH = '.'.

ITAB_C-CITY = LFA1-ORT01.

ITAB_C-AFM = LFA1-STCD2.

ITAB_C-AFORA = YAPAL-AFORA.

  • ITAB_C-ORIO_VAL = YAPAL-VORIO.

WRITE YAPAL-VORIO CURRENCY 'eur' TO ITAB_C-ORIO_VAL.

  • ITAB_C-OLD_VAL = YAPAL-V_OLD.

WRITE YAPAL-V_OLD CURRENCY 'eur' TO ITAB_C-OLD_VAL.

  • ITAB_C-VAL_1 = YAPAL-VAL_N.

WRITE YAPAL-VAL_N CURRENCY 'eur' TO ITAB_C-VAL_1.

VV = YAPAL-V_OLD - YAPAL-VAL_N.

WRITE VV CURRENCY 'eur' TO ITAB_C-VAL_2.

  • ITAB_C-VAL_3 = YAPAL-VAL_P.

WRITE YAPAL-VAL_P CURRENCY 'eur' TO ITAB_C-VAL_3.

VV = YAPAL-V_OLD - YAPAL-VAL_N + YAPAL-VAL_P.

WRITE VV CURRENCY 'eur' TO ITAB_C-VAL_4.

  • ITAB_C-VAL_5 = YAPAL-V_NEW.

WRITE YAPAL-V_NEW CURRENCY 'eur' TO ITAB_C-VAL_5.

ITAB_C-VAL_TXT = '.'.

ITAB_C-VAL_TXT2 = '.'.

ELSE. "DEN BRIKE IDIO

CLEAR YAPAL.

V_OLD = 0.

SELECT * FROM YAPAL WHERE MJAHR = P_MJAHR.

P_VORIO = YAPAL-VORIO .

V_OLD = V_OLD + YAPAL-VAL_P - YAPAL-VAL_N .

P_AR_MIT = YAPAL-AR_MITR .

ENDSELECT.

CLEAR YAPAL.

SELECT SINGLE * FROM LFA1 WHERE LIFNR = P_LIFNR.

YAPAL-AR_MITR = P_AR_MIT .

YAPAL-MJAHR = P_MJAHR.

YAPAL-APALN = P_APALN.

YAPAL-AFORA = P_AFORA.

YAPAL-LIFNR = LFA1-LIFNR.

YAPAL-DDATE = P_DDATE.

YAPAL-VAL_P = P_VAL_P.

YAPAL-VAL_N = P_VAL_N.

YAPAL-VORIO = P_VORIO.

YAPAL-V_OLD = V_OLD.

VAL_A = YAPAL-V_OLD - YAPAL-VAL_N.

VAL_B = VAL_A + YAPAL-VAL_P.

YAPAL-V_NEW = YAPAL-VORIO - VAL_B.

ITAB_C-AR_MITR = YAPAL-AR_MITR.

ITAB_C-NAME = LFA1-NAME1.

ITAB_C-OCCUPA = LFA1-NAME3.

ITAB_C-DOY = LFA1-NAME4.

ITAB_C-ODOS = LFA1-STRAS.

ITAB_C-ARITH = '.'.

ITAB_C-CITY = LFA1-ORT01.

ITAB_C-AFM = LFA1-STCD2.

ITAB_C-AFORA = YAPAL-AFORA.

  • ITAB_C-ORIO_VAL = YAPAL-VORIO.

WRITE YAPAL-VORIO CURRENCY 'eur' TO ITAB_C-ORIO_VAL.

  • ITAB_C-OLD_VAL = YAPAL-V_OLD.

WRITE YAPAL-V_OLD CURRENCY 'eur' TO ITAB_C-OLD_VAL.

  • ITAB_C-VAL_1 = YAPAL-VAL_N.

WRITE YAPAL-VAL_N CURRENCY 'eur' TO ITAB_C-VAL_1.

VV = VAL_A.

WRITE VV CURRENCY 'eur' TO ITAB_C-VAL_2.

  • ITAB_C-VAL_3 = YAPAL-VAL_P.

WRITE YAPAL-VAL_P CURRENCY 'eur' TO ITAB_C-VAL_3.

VV = VAL_B.

WRITE VV CURRENCY 'eur' TO ITAB_C-VAL_4.

  • ITAB_C-VAL_5 = YAPAL-V_NEW.

WRITE YAPAL-V_NEW CURRENCY 'eur' TO ITAB_C-VAL_5.

ITAB_C-VAL_TXT = '.'.

ITAB_C-VAL_TXT2 = '.'.

IF P_CHECK = ' '.

INSERT YAPAL.

MOVE 'X' TO FIRST_TIME.

ENDIF.

ENDIF. " DEN BRIKE IDIO

WRITE: / .

WRITE: / .

WRITE: / .

WRITE: / .

WRITE: / .

WRITE: / .

WRITE: /65 ITAB_C-AR_MITR.

WRITE: / .

WRITE: / .

WRITE: / .

WRITE: / .

WRITE: / .

WRITE: / .

WRITE: / .

WRITE: / ' ', ITAB_C-NAME INPUT .

WRITE: / ' ', ITAB_C-OCCUPA INPUT .

WRITE: / ' ', ITAB_C-DOY INPUT .

WRITE: / ' ', ITAB_C-ODOS INPUT

,40 ' ', ITAB_C-ARITH INPUT

,55 ' ', ITAB_C-CITY INPUT .

WRITE: / ' ', ITAB_C-AFM INPUT .

WRITE: / .

WRITE: / .

WRITE: /60 ' ', ITAB_C-ORIO_VAL .

WRITE: /.

WRITE: /.

WRITE: /.

WRITE: /31 ITAB_C-OLD_VAL .

WRITE: /.

WRITE: /25 ITAB_C-VAL_1 , 45 ITAB_C-VAL_2 .

WRITE: /.

WRITE: /.

WRITE: /.

WRITE: / ITAB_C-AFORA INPUT,45 ITAB_C-VAL_3

,65 ITAB_C-VAL_4 .

WRITE: /.

WRITE: /65 ITAB_C-VAL_5 .

WRITE: /.

WRITE: /.

PERFORM GET_TOTAL_AMOUNT USING ITAB_C-VAL_5 CHANGING ITAB_C-V_TXT.

ITAB_C-VAL_TXT = ITAB_C-V_TXT+0(69).

CONCATENATE ITAB_C-V_TXT+69(70) '.' INTO ITAB_C-VAL_TXT2.

WRITE: /13 ITAB_C-VAL_TXT INPUT.

WRITE: /13 ITAB_C-VAL_TXT2 INPUT.

WRITE: /.

WRITE: /.

WRITE: /60 ' ' , YAPAL-DDATE.

  • write: /65 'u039F u0394u0399u039Au0391u0399u039Fu03A5u03A7u039Fu03A3 '.

NEW-PAGE.

*==========================================================

END-OF-SELECTION.

&----


*& Form INFORM

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM INFORM .

DATA : ANS TYPE ANSWER.

CLEAR ANS.

CALL FUNCTION 'POPUP_WITH_2_BUTTONS_TO_CHOOSE'

EXPORTING

  • DEFAULTOPTION = '1'

DIAGNOSETEXT1 = ' '

DIAGNOSETEXT2 = ' '

  • DIAGNOSETEXT3 = ' '

TEXTLINE1 = 'zzzzzzzzzzzzzzz'

TEXTLINE2 = 'zzzzzzzzzzzzzzzzzzzzzz'

  • TEXTLINE3 = ' '

TEXT_OPTION1 = 'xxxxxxxxxxxxxxxxx'

TEXT_OPTION2 = 'ffffffffffffffffff'

TITEL = 'fffffffffffffffff'

IMPORTING

ANSWER = ANS .

IF ANS = '1'.

SUBMIT SAPLZHALM1.

ENDIF.

IF ANS = '2'.

ENDIF.

ENDFORM. " INFORM

Tags:

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question