Create variable in program dinamically
Hi Gurus,
I know it is possible create internal tables and structures like this internal table.. but...
Is it possible create a variable dinamically in ABAP program???
Thanks in advance.
Yes.
DATA lp_data TYPE REF TO DATA.
FIELD-SYMBOLS: <FS>.
CONSTANTS c_type TYPE c LENGTH 1 VALUE 'F'.
CREATE DATA lp_data TYPE (c_type).
ASSIGN lp_data->* TO <FS>.
The field symbol is now a floating point variable. You can have any type, and also construct your own types dynamically, using the RTTS (search for info).
You can also create internal tables dynamically by building on these techniques.
Similar Messages
-
Creating variables in a java swing program useing event
This is my code:
*Old School Calculator
*@Collin Doering
*Version 2.00
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class OSC {
private static void createAndShowGUI() {
int first = 0;
int second = 0;
int third = 0;
int fourth = 0;
int fifth = 0;
int answer;
System.out.println ("Calculations");
System.out.println ("-------------");
JFrame.setDefaultLookAndFeelDecorated(true);
JFrame frame = new JFrame("OSC");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JButton button1 = new JButton("1");
button1.setMnemonic(1);
button1.addActionListener
new ActionListener() {
public void actionPerformed (ActionEvent e) {
first = 1;
//This is when the error says "Local variable first is accesed from
with in inner class; needs to be declared final;
System.out.println ("first = ");
JButton button2 = new JButton("2");
button2.setMnemonic(2);
button2.addActionListener
new ActionListener() {
public void actionPerformed (ActionEvent e) {
System.out.println ("Second = ");
JButton buttonx = new JButton("x");
buttonx.addActionListener
new ActionListener() {
public void actionPerformed (ActionEvent e) {
System.out.println ("answer: ");
JPanel panel = new JPanel(new GridLayout(10,10));
panel.add(button1);
panel.add(button2);
panel.add(buttonx);
frame.getContentPane().add(panel);
panel.setBorder(BorderFactory.createEmptyBorder(
30, //top
30, //left
10, //bottom
30) //right
frame.pack();
frame.setVisible(true);
public static void main(String[] args) {
javax.swing.SwingUtilities.invokeLater(new Runnable() {
public void run() {
createAndShowGUI();
I am trying to create variables so i can make a calculator (right now i only have buttons 1, 1 and multiply). //This is when the error says "Local variable first is accesed from
with in inner class; needs to be declared final; then when i declare it final it says <identifier expected>. Could some one please help me. thanx.Please post code within code tags (press the "code" button).
Why are you using an inner class? Simplify:
public class OSC implements ActionListener {
button1.addActionListener( this );
public void actionPerformed( ActionEvent e ) {
if ( e.getSource() == button1 ) . . . -
Help with project: trying to create variables from decimals
topic may be a bit unclear, but I have a project from a java course. I need to create a simple program, but hit a bit of a bump.
I have made a formula to find that the total hours equals 2.7350 which is equal to 2hours, 44minutes, 6seconds.
so to sum what I just said up, I have the number 2.7350, but need to display 2hours, 44minutes, 6seconds
now I need help of how I can accomplish this with basic java (this is my first java class).
If there is a way to leave 2 and take .7350 in separate variables, I can make some more formulas to convert that to the answer I need displayed, but I don't know how.
Please help if you have ideas
Thank Youahh, that just gave me an idea, I can't believe subtraction didn't come into my mind.
I also should have mentioned that the numbers are generated via formula and user input, so it is not pre set.
I will try something out with the subtraction idea. however, if you have a solution please post it in case my idea doesn't work.
thanks again ^^ -
HOW TO CREATE A DRILLDOWN PROGRAM NEED EXAMPLE
HAI FRIENDS
1 I WANT TO KNOW HOW TO CREATE A DRILLDOWN PROGRAM NEED EXAMPLE IN ABAP
2 NEED ABAP PROGRAM EBOOK
PLZ DO ITCHECK THIS ALV DRILL DOWN REPORT
*& Report ZHAI_SD_CUSTOMER_DETAILS_ALV
REPORT ZHAI_SD_CUSTOMER_DETAILS_ALV.
TYPE-POOLS: SLIS.
TYPES DECLARATIONS
TABLES : KNA1.
DATA : BEGIN OF IT_CUST OCCURS 0,
KUNNR LIKE KNA1-KUNNR,
NAME1 LIKE KNA1-NAME1,
LAND1 LIKE KNA1-LAND1,
ORT01 LIKE KNA1-ORT01,
STRAS LIKE KNA1-STRAS,
PSTLZ LIKE KNA1-PSTLZ,
END OF IT_CUST.
DATA:BEGIN OF IT_SALE OCCURS 0,
VBELN LIKE VBAK-VBELN,"SALES DOC NO
AUDAT LIKE VBAK-AUDAT,"DATE RECIEVED AND SENT
AUART LIKE VBAK-AUART,"SALES DOC LIKE
NETWR LIKE VBAK-NETWR,"NET VALUE IN DOC CURRENCY
KUNNR LIKE VBAK-KUNNR,
END OF IT_sale.
TYPES: BEGIN OF TY_ITEM,
VBELN TYPE VBAP-VBELN,
POSNR TYPE VBAP-POSNR,"ITEM NO
MATNR TYPE VBAP-MATNR,"MATERIAL NO
CHARG TYPE VBAP-CHARG,"BATCH
MATKL TYPE VBAP-MATKL,"MATERIAL GROUP
MEINS TYPE VBAP-MEINS,"BASE UNIT OF MEASURE
END OF TY_ITEM.
SELECT-OPTIONS : S_KUNNR FOR KNA1-KUNNR.
INTERNAL TABLES
DATA:
IT_CUST TYPE TABLE OF TY_CUST,
IT_SALE TYPE TABLE OF TY_SALE,
IT_ITEM TYPE TABLE OF TY_ITEM.
INTERNAL TABLES FOR ALV
DATA: IT_FCAT TYPE SLIS_T_FIELDCAT_ALV,
IT_FCAT1 TYPE SLIS_T_FIELDCAT_ALV,
IT_FCAT3 TYPE SLIS_T_FIELDCAT_ALV.
DATA: IT_EVENTS TYPE TABLE OF slis_alv_event,
IT_EVENTS1 TYPE TABLE OF SLIS_ALV_EVENT,
IT_EVENTS2 TYPE TABLE OF SLIS_ALV_EVENT.
DATA: IT_LISTHEADER1 TYPE SLIS_T_LISTHEADER,
IT_LISTHEADER TYPE TABLE OF slis_listheader,
IT_LISTHEADER3 TYPE TABLE OF SLIS_LISTHEADER,
IT_FOOTER TYPE TABLE OF SLIS_LISTHEADER.
DATA: IT_SORT TYPE SLIS_T_SORTINFO_ALV,
WA_SORT LIKE LINE OF IT_SORT.
WORK AREAS FOR ALV
DATA: WA_LAYOUT TYPE SLIS_LAYOUT_ALV,
WA_LAYOUT1 TYPE SLIS_LAYOUT_ALV,
WA_FCAT LIKE LINE OF IT_FCAT,
WA_FCAT1 LIKE LINE OF IT_FCAT1,
WA_FCAT3 LIKE LINE OF IT_FCAT3,
WA_EVENTS LIKE LINE OF IT_EVENTS,
WA_EVENTS1 LIKE LINE OF IT_EVENTS,
WA_EVENTS2 LIKE LINE OF IT_EVENTS.
WORK VARIABLES
DATA: W_REPID TYPE SY-REPID,
W_KUNNR TYPE KNA1-KUNNR.
$$**----
WORK AREAS
MACROS
DEFINE ADD_FCAT1..
WA_FCAT1-COL_POS = &1.
WA_FCAT1-FIELDNAME = &2.
WA_FCAT1-TABNAME = &3.
WA_FCAT1-REF_TABNAME = &4.
WA_FCAT1-KEY = &5.
WA_FCAT1-DO_SUM = &6.
WA_FCAT1-HOTSPOT = &7.
WA_FCAT1-EMPHASIZE = &8.
APPEND WA_FCAT1 TO IT_FCAT1.
END-OF-DEFINITION.
START-OF-SELECTION.
PERFORM F_GET_DATA.
PERFORM F_BUILD_FCAT.
PERFORM F_GET_EVENTS.
PERFORM F_BUILD_LAYOUT USING WA_LAYOUT.
PERFORM F_GET_DISPLAY.
*& Form F_GET_DATA
FORM F_GET_DATA .
SELECT KUNNR
NAME1
LAND1
ORT01
STRAS
PSTLZ FROM KNA1
INTO TABLE
IT_CUST WHERE KUNNR IN S_KUNNR.
ENDFORM. " F_GET_DATA
*& Form F_GET_DISPLAY
text
--> p1 text
<-- p2 text
FORM F_GET_DISPLAY .
CLEAR W_REPID.
MOVE SY-REPID TO W_REPID.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = w_repid
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
I_CALLBACK_TOP_OF_PAGE = 'F_TOP_OF_PAGE'
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = 'DUCK'
I_GRID_TITLE =
I_GRID_SETTINGS =
IS_LAYOUT = WA_LAYOUT
IT_FIELDCAT = IT_FCAT
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS = IT_EVENTS
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
I_HTML_HEIGHT_TOP = 0
I_HTML_HEIGHT_END = 0
IT_ALV_GRAPHICS =
IT_HYPERLINK =
IT_ADD_FIELDCAT =
IT_EXCEPT_QINFO =
IR_SALV_FULLSCREEN_ADAPTER =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = IT_CUST
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " F_GET_DISPLAY
*& Form F_GET_EVENTS
text
--> p1 text
<-- p2 text
FORM F_GET_EVENTS .
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 0
IMPORTING
ET_EVENTS = IT_EVENTS
EXCEPTIONS
LIST_TYPE_WRONG = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
SORT IT_EVENTS.
READ TABLE IT_EVENTS INTO WA_EVENTS
WITH KEY NAME = 'TOP_OF_PAGE' BINARY SEARCH.
IF SY-SUBRC EQ 0.
WA_EVENTS-FORM = 'F_TOP_OF_PAGE'.
MODIFY IT_EVENTS INDEX SY-TABIX FROM
WA_EVENTS TRANSPORTING FORM.
ENDIF.
READ TABLE IT_EVENTS INTO WA_EVENTS
WITH KEY NAME = 'USER_COMMAND' BINARY SEARCH.
IF SY-SUBRC EQ 0.
WA_EVENTS-FORM = 'F_USER_COMMAND'.
MODIFY IT_EVENTS FROM WA_EVENTS INDEX
SY-TABIX TRANSPORTING FORM.
READ TABLE IT_EVENTS INTO WA_EVENTS
WITH KEY NAME = 'USER_COMMAND' BINARY SEARCH.
ENDIF.
READ TABLE IT_EVENTS INTO WA_EVENTS WITH
KEY NAME = 'END_OF_PAGE' BINARY SEARCH.
IF SY-SUBRC EQ 0.
WA_EVENTS-FORM = 'F_END_OF_PAGE'.
MODIFY IT_EVENTS FROM WA_EVENTS
INDEX SY-TABIX TRANSPORTING FORM.
ENDIF.
ENDFORM. "F_GET_EVENTS
*& Form F_BUILD_LAYOUT
FORM F_BUILD_LAYOUT USING P_WA_LAYOUT LIKE WA_LAYOUT .
CLEAR P_WA_LAYOUT.
P_WA_LAYOUT-COLWIDTH_OPTIMIZE = 'X'.
*P_WA_LAYOUT-F2CODE = '&ETA'.
*p_wa_layout-detail_popup = 'X'.
P_WA_LAYOUT-DETAIL_TITLEBAR = 'ALV REPORT'.
*P_WA_LAYOUT-CONFIRMATION_PROMPT = 'X'.
ENDFORM. " F_BUILD_LAYOUT
*& Form F_TOP_OF_PAGE
FORM F_TOP_OF_PAGE .
refresh it_listheader.
DATA: LS_LIST TYPE SLIS_LISTHEADER.
LS_LIST-TYP = 'H'.
LS_LIST-INFO = TEXT-004.
APPEND LS_LIST TO IT_LISTHEADER.
LS_LIST-typ = 'S'.
LS_LIST-key = 'Date: '.
CONCATENATE sy-datum+6(2) '.'
sy-datum+4(2) '.'
sy-datum(4) INTO LS_LIST-info. "todays date
append LS_LIST to IT_LISTHEADER.
clear: LS_LIST.
LS_LIST-TYP = 'S'.
LS_LIST-KEY = 'DEVELOPED:'.
LS_LIST-INFO = SY-UNAME.
APPEND LS_LIST TO IT_LISTHEADER.
CLEAR LS_LIST.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = IT_LISTHEADER
I_LOGO = 'GLOBAL'.
ENDFORM. " F_TOP_OF_PAGE
*& Form F_BUILD_FCAT
FORM F_BUILD_FCAT .
CLEAR: W_REPID,
IT_FCAT.
MOVE SY-REPID TO W_REPID.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = W_REPID
I_INTERNAL_TABNAME = 'IT_CUST'
I_INCLNAME = W_REPID
CHANGING
CT_FIELDCAT = IT_FCAT
EXCEPTIONS
INCONSISTENT_INTERFACE = 1
PROGRAM_ERROR = 2
OTHERS = 3
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " F_BUILD_FCAT
*& Form F_USER_COMMAND
FORM F_USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
RS_SELFIELD TYPE SLIS_SELFIELD.
CASE R_UCOMM.
WHEN '&IC1'.
IF RS_SELFIELD-FIELDNAME = 'KUNNR'.
READ TABLE IT_CUST
INDEX RS_SELFIELD-TABINDEX.
MOVE rs_selfield-value TO W_KUNNR.
IF IT_CUST IS NOT INITIAL.
PERFORM F_GET_SECONDARY_DATA.
PERFORM F_BUILD_FCAT1.
PERFORM F_BUILD_EVENTS.
PERFORM F_GET_SORT.
PERFORM F_BUILD_LAYOUT1.
PERFORM F_GET_DISPLAY1.
ENDIF.
ENDIF.
ENDCASE.
ENDFORM. " F_USER_COMMAND
*& Form F_GET_SECONDARY_DATA
FORM F_GET_SECONDARY_DATA .
data:v_data.
SELECT VBELN
AUDAT
AUART
NETWR
KUNNR FROM VBAK INTO TABLE IT_SALE
WHERE KUNNR EQ IT_CUST-KUNNR.
IF IT_SALE[] IS INITIAL .
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
TITLEBAR = SY-REPID
DIAGNOSE_OBJECT = ' '
TEXT_QUESTION = 'NO SALES FOR THIS CUSTOMER'
TEXT_BUTTON_1 = 'Ja'(001)
ICON_BUTTON_1 = ' '
TEXT_BUTTON_2 = 'Nein'(002)
ICON_BUTTON_2 = ' '
DEFAULT_BUTTON = '1'
DISPLAY_CANCEL_BUTTON = 'X'
USERDEFINED_F1_HELP = ' '
START_COLUMN = 25
START_ROW = 6
POPUP_TYPE =
IV_QUICKINFO_BUTTON_1 = ' '
IV_QUICKINFO_BUTTON_2 = ' '
IMPORTING
ANSWER = v_data
TABLES
PARAMETER =
EXCEPTIONS
TEXT_NOT_FOUND = 1
OTHERS = 2
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
case v_data.
when '2'.
leave screen.
when 'A'.
leave to screen '0'.
endcase.
ENDIF.
ENDFORM. " F_GET_SECONDARY_DATA
*& Form F_BUILD_FCAT1
FORM F_BUILD_FCAT1 .
REFRESH IT_FCAT1.
CLEAR WA_FCAT1.
ADD_FCAT1:
'1' 'VBELN' 'VBAK' 'VBAK' 'X' ' ' 'X' 'C500',
'2' 'AUDAT' 'VBAK' 'VBAK' ' ' ' ' ' ' 'C400',
'3' 'AUART' 'VBAK' 'VBAK' ' ' ' ' ' ' 'C100',
'4' 'NETWR' 'VBAK' 'VBAK' ' ' 'X' ' ' 'C300'.
ENDFORM. " F_BUILD_FCAT1
*& Form F_GET_DISPLAY1
text
--> p1 text
<-- p2 text
FORM F_GET_DISPLAY1 .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = 'F_USER_COMMAND1'
I_CALLBACK_TOP_OF_PAGE = 'F_TOP_OF_PAGE1'
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
I_GRID_TITLE =
I_GRID_SETTINGS =
IS_LAYOUT =
IT_FIELDCAT = IT_FCAT1
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT = IT_SORT
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS = IT_EVENTS1
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
I_HTML_HEIGHT_TOP = 0
I_HTML_HEIGHT_END = 0
IT_ALV_GRAPHICS =
IT_HYPERLINK =
IT_ADD_FIELDCAT =
IT_EXCEPT_QINFO =
IR_SALV_FULLSCREEN_ADAPTER =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = IT_SALE
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " F_GET_DISPLAY1
*& Form F_BUILD_EVENTS
FORM F_BUILD_EVENTS .
clear wa_events1.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 0
IMPORTING
ET_EVENTS = IT_EVENTS1.
EXCEPTIONS
LIST_TYPE_WRONG = 1
OTHERS = 2
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
SORT IT_EVENTS1.
read table It_events1 with key name = 'TOP_OF_PAGE'
into WA_eventS1.
if sy-subrc = 0.
move 'F_TOP_OF_PAGE1' to WA_EventS1-form.
append WA_eventS1 to it_events1.
endif.
READ TABLE IT_EVENTS WITH KEY NAME = 'USER_COMMAND'
INTO WA_EVENTS1.
IF SY-SUBRC = 0.
MOVE 'F_USER_COMMAND1' TO WA_EVENTS1-FORM.
APPEND WA_EVENTS1 TO IT_EVENTS1.
ENDIF.
*READ TABLE IT_EVENTS WITH KEY NAME = 'SUBTOTAL_TEXT'
INTO WA_EVENTS1.
IF SY-SUBRC = 0.
MOVE 'F_SUBTOTAL_TEXT' TO WA_EVENTS1-FORM.
APPEND WA_EVENTS1 TO IT_EVENTS1.
ENDIF.
ENDFORM. " F_BUILD_EVENTS
*& Form F_TOP_OF_PAGE1
FORM F_TOP_OF_PAGE1 .
DATA: LS_HEADER TYPE SLIS_LISTHEADER.
REFRESH : IT_LISTHEADER1.
LS_HEADER-TYP = 'H'.
LS_HEADER-INFO = 'SALES ORDER DETAILS FOR CUSTOMER'.
APPEND LS_HEADER TO it_listheader1.
CLEAR LS_HEADER.
LS_HEADER-TYP = 'S'.
LS_HEADER-KEY = 'CUSTOMER NO:'.
LS_HEADER-INFO = W_KUNNR.
APPEND LS_HEADER TO IT_LISTHEADER1.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = IT_LISTHEADER1
I_LOGO = 'DUCK'
I_END_OF_LIST_GRID =
I_ALV_FORM =
ENDFORM. " F_TOP_OF_PAGE
*& Form F_END_OF_PAGE
text
--> p1 text
<-- p2 text
FORM F_END_OF_PAGE .
DATA:LS_FOOTER TYPE SLIS_LISTHEADER.
LS_FOOTER-TYP = 'S'.
LS_FOOTER-KEY = SY-UNAME.
LS_FOOTER-INFO = 'DEVELOPED BY:'.
APPEND LS_FOOTER TO IT_FOOTER.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = IT_FOOTER
ENDFORM. " F_END_OF_PAG
*& Form F_USER_COMMAND1
text
--> p1 text
<-- p2 text
FORM F_USER_COMMAND1 USING R_UCOMM LIKE SY-UCOMM
RS_SELFIELD TYPE SLIS_SELFIELD.
CASE R_UCOMM.
WHEN '&IC1'.
READ TABLE IT_SALE INDEX RS_SELFIELD-TABINDEX.
PERFORM F_GET_SECONDARY2.
PERFORM F_GET_FCAT3 USING:
'VBELN' '1' 'C' '12' 'SALES_DOC' 'M' 'VBAP' 'X' 'C51' ' ',
'POSNR' '2' ' ' '5' 'ITEM_NO' 'M' 'VBAP' ' ' 'C61' ' ',
'MATNR' '3' ' ' '12' 'MATERIAL_NO' 'M' 'VBAP' ' ' 'C71' ' ',
'CHARG' '4' ' ' '10' 'BATCH_NO' 'M' 'VBAP' ' ' 'C41' ' ',
'MATKL' '5' ' ' '10' 'MAT_GROUP' 'M' 'VBAP' ' ' 'C31' ' ',
'MEINS' '6' ' ' '12' 'BASE_UNIT' 'M' 'VBAP' ' ' 'C21' 'X' .
PERFORM F_GET_EVENTS2 USING WA_EVENTS2
CHANGING IT_EVENTS2.
PERFORM F_GET_DISPLAY3.
REFRESH IT_FCAT3.
ENDCASE.
ENDFORM. " F_USER_COMMAND1
*& Form F_GET_SECONDARY2
text
--> p1 text
<-- p2 text
FORM F_GET_SECONDARY2 .
SELECT VBELN
POSNR
MATNR
MATKL
MEINS
FROM VBAP INTO
TABLE IT_ITEM WHERE
VBELN EQ IT_SALE-VBELN.
IF SY-DBCNT EQ 0.
MESSAGE E000(ZHAI) WITH TEXT-KO1.
ENDIF.
ENDFORM. " F_GET_SECONDARY2
*& Form F_GET_DISPLAY3
text
--> p1 text
<-- p2 text
FORM F_GET_DISPLAY3 .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
I_CALLBACK_PF_STATUS_SET = 'F_PF_STATUS'
I_CALLBACK_USER_COMMAND = ' '
I_CALLBACK_TOP_OF_PAGE = 'F_TOP_OF_PAGE3'
I_CALLBACK_HTML_TOP_OF_PAGE = 'F_TOP_OF_PAGE3'
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
I_GRID_TITLE =
I_GRID_SETTINGS =
IS_LAYOUT = WA_LAYOUT1
IT_FIELDCAT = IT_FCAT3
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT = IT_SORT
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS = IT_EVENTS2
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
I_HTML_HEIGHT_TOP = 0
I_HTML_HEIGHT_END = 0
IT_ALV_GRAPHICS =
IT_HYPERLINK =
IT_ADD_FIELDCAT =
IT_EXCEPT_QINFO =
IR_SALV_FULLSCREEN_ADAPTER =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = IT_ITEM
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " F_GET_DISPLAY3
*& Form F_GET_FCAT3
FORM F_GET_FCAT3 USING VALUE(P1)
VALUE(P2)
VALUE(P3)
VALUE(P4)
VALUE(P5)
VALUE(P6)
VALUE(P7)
VALUE(P8)
VALUE(P9)
VALUE(P10).
CLEAR WA_FCAT3.
WA_FCAT3-FIELDNAME = P1.
WA_FCAT3-COL_POS = P2.
WA_FCAT3-JUST = P3.
WA_FCAT3-OUTPUTLEN = P4.
WA_FCAT3-SELTEXT_M = P5.
WA_FCAT3-DDICTXT = P6.
WA_FCAT3-REF_TABNAME = P7.
WA_FCAT3-HOTSPOT = P8.
WA_FCAT3-EMPHASIZE = P9.
WA_FCAT3-DO_SUM = P10.
APPEND WA_FCAT3 TO IT_FCAT3.
ENDFORM. " F_GET_FCAT3
*& Form F_BUILD_LAYOUT1
text
--> p1 text
<-- p2 text
FORM F_BUILD_LAYOUT1 .
WA_LAYOUT1-totals_text = 'TOTAL'.
wa_layout1-detail_popup = 'X'.
ENDFORM. " F_BUILD_LAYO
*& Form F_GET_EVENTS2
text
-->P_IT_EVENTS2 text
<--P_WA_EVENTS2 text
FORM F_GET_EVENTS2 USING VALUE(P_WA_EVENTS2) LIKE WA_EVENTS2
CHANGING P_IT_EVENTS2 LIKE IT_EVENTS2.
P_WA_EVENTS2-NAME = 'HTML_TOP_OF_PAGE'.
P_WA_EVENTS2-FORM = 'F_TOP_OF_PAGE3'.
APPEND P_WA_EVENTS2 TO P_IT_EVENTS2.
CLEAR P_WA_EVENTS2.
P_WA_EVENTS2-NAME = 'PF_STATUS'.
P_WA_EVENTS2-FORM = 'F_PF_STATUS'.
APPEND P_WA_EVENTS2 TO P_IT_EVENTS2.
CLEAR P_WA_EVENTS2.
P_WA_EVENTS2-NAME = 'USER_COMMAND'.
P_WA_EVENTS2-FORM = 'F_USER_COMMAND3'.
APPEND P_WA_EVENTS2 TO P_IT_EVENTS2.
CLEAR P_WA_EVENTS2.
p_wa_events2-name = 'HTML_END_OF_LIST'.
P_WA_EVENTS2-FORM = 'F_HTML_END_OF_LIST'.
APPEND P_WA_EVENTS2 TO P_IT_EVENTS2.
CLEAR p_wa_events2.
ENDFORM. " F_GET_EVENTS2
*& Form F_TOP_OF_PAGE3
text
--> p1 text
<-- p2 text
FORM F_TOP_OF_PAGE3 USING DOCUMENT TYPE REF TO cl_dd_document .
data : link_area type ref to cl_dd_area,
picture_area type ref to cl_dd_area.
CALL METHOD DOCUMENT->ADD_TEXT
EXPORTING
TEXT = 'ALV REPORT'
TEXT_TABLE =
FIX_LINES =
SAP_STYLE =
SAP_COLOR = cl_dd_area=>list_background_int
SAP_FONTSIZE = 'LARGE'
SAP_FONTSTYLE = 'TIMES'
SAP_EMPHASIS = 'STRONG'
STYLE_CLASS =
CHANGING
DOCUMENT =
CALL METHOD DOCUMENT->NEW_LINE.
CALL METHOD DOCUMENT->ADD_PICTURE
EXPORTING
PICTURE_ID = 'LOGO1'
WIDTH = '10%'
ENDFORM. " F_TOP_OF_PAGE3
*& Form F_GET_SORT
text
--> p1 text
<-- p2 text
FORM F_GET_SORT .
WA_SORT-FIELDNAME = 'NETWR'.
WA_SORT-SPOS = 4.
WA_SORT-UP = 'X'.
WA_SORT-SUBTOT = 'X'.
APPEND WA_SORT TO IT_SORT.
ENDFORM. " F_GET_SORT
*& Form F_PF_STATUS
text
--> p1 text
<-- p2 text
FORM F_PF_STATUS USING RS_EXTAB TYPE SLIS_T_EXTAB .
SET PF-STATUS 'ZHAIALV' EXCLUDING RS_EXTAB.
ENDFORM. " F_PF_STATUS
*& Form F_USER_COMMAND3
text
--> p1 text
<-- p2 text
FORM F_USER_COMMAND3 USING R_UCOMM LIKE SY-UCOMM
RS_SELFIELD TYPE SLIS_SELFIELD.
CASE R_UCOMM.
WHEN '&SALE'.
IF RS_SELFIELD-FIELDNAME = 'VBELN'.
SET parameter ID 'AUN' FIELD rs_selfield-value.
CALL TRANSACTION 'VA02' AND SKIP FIRST SCREEN.
ENDIF.
WHEN '&MAT'.
IF RS_SELFIELD-FIELDNAME = 'MATNR'.
SET PARAMETER ID 'MAT' FIELD RS_SELFIELD-VALUE.
CALL TRANSACTION 'MM02' AND SKIP FIRST SCREEN.
ENDIF.
ENDCASE.
ENDFORM. " F_USER_COMMAND3
*& Form F_HTML_END_OF_LIST
text
--> p1 text
<-- p2 text
FORM F_HTML_END_OF_LIST USING DOCUMENT TYPE REF TO CL_DD_DOCUMENT.
DATA : PAGE TYPE SDYDO_TEXT_ELEMENT.
MOVE SY-PAGNO TO PAGE.
CALL METHOD DOCUMENT->ADD_TEXT
EXPORTING
TEXT = PAGE
TEXT_TABLE =
FIX_LINES =
SAP_STYLE =
SAP_COLOR =
SAP_FONTSIZE =
SAP_FONTSTYLE =
SAP_EMPHASIS =
STYLE_CLASS =
CHANGING
DOCUMENT =
ENDFORM. " F_HTML_END_OF_LIS -
Defining Selection variables for program variant, TVARV table Help - urgent
Hi All,
Can anyone tell me, what is the transaction to create new variables in table TVARV to use them in my variant for fiscal year and WIP period fields in selection screen of SAPKKA07 program.I used STVARV and it creates variables in table TVARVC table not in TVARV table and moreover in creating a variant the selection variables are defaulted as variables from TVARVC table as input help but not the variables in TVARV table however I see and understand different from SAP Help. The following is the link
http://help.sap.com/saphelp_47x200/helpdata/en/25/c966398ae5c13ae10000000a114084/frameset.htm
for selection variable creation.
Can anyone help me on this this is very urgent. Your help is highly appreciated
Thanks in advance
KumarThanks Appana,
I know we can create the variable that way but, that is something hardway to do it. I want to go about it from transaction not meaning to update the table directly and moreover if I update the TVARV table directly as u said I still dont see the variable I created in the list I get on input help for selection variables while creating a program variant.
I hope u can suggest me better now.
Thanks
Kumar -
Create a custom program for FPS3 transaction code
Hi,
I would like to create a custome program which does the below steps in one shot.
1) RUN(SUBMIT) Transaction FPS3 with
Company code = NONE and
Created on FROM = SY-DATUM & TO = SY-DATUM
2) In the next screen, it should select SELECT ALL
button
3) and then it should select EXECUTE button.
And alos i should be able to give Information Messages when nothing is selected or displayed.
Thanks & Regards,
Sudheer Pusala.write a z program with company code as parameter. next use Submit function to submit FPS3 with the variables. In the PF-STATUS maintain the required butons which will popup when the data is shown. Now, u can select all records from one of the button of PF-STATUS (u need to write code for it). Next use execute button to execute the data. At any stage u can improper ur custom messages which will get displayed as and when something happens.
-
Creating variables in Report Painter
Hi ...
I would like to know ... how do I create variable ? I know it is via T CODE GS11, but when run tht, in the next screen it pops up for variable ? What variable do I need to enter ? is this predelivered Eg : CE-PK, or can we create one ? Please advise
Also, I would like to I have a requirement for a report whereby the format is like this .....
SALES CURR MONTH (06/2006) LAST YEAR
- Sales IT
- Sales 1
- Sales 2
COGS
- cogs 1
- cogs 2
- cogs 3
COS
- cos 1
- cos 2
- cos 3
GROSS PROFIT
Whereby, SALES = sales it + sales 1 + sales 2, COGS = cogs 1+cogs 2 + cogs 3, COS = cos 1+ cos 2+ cos 3. also GROSS PROFIT = SALES + COGS + COS
The abpve report is inclusive of Cost Centre and Profit Centre, how acn I utilize the libraray in Report Pianter to create such report, is this possible in Report Painter whereby including Cost center and Profit Centre in one single report
Pls assist me
NathanWhen you create your variable first enter the variable name. Second enter the reporting "table" to use. Third enter the "field'. Press enter. Next enter a default value for your field. Save you variable. It is now ready to use in your report painter.
Using the PCA reporting tables gives you the profit center but not the cost center. You can only use one reporting table per report. you will need a cctr report for that.
First create your own libray from GLPCT. Next create your report using your new library. The report painter can do the calculations that you have shown.
You create a formula in the row or column to calculate your sub totals.
pls assign points if helpful as a way to say thanks. -
How to create variable in BEx on a Nav Attribute?
Hi All,
We are creating a report on Master data object 0MILESTONE. 0PROJECT is the navigational attribute of 0milestone.
and ZSTATUS is the navigational attribute of 0PROJECT.
Requirement is to create variable on ZSTATUS in BEx. How do I do that? I dont see option of creating variable on Nav attribute of a Nav attribute.
Regards,
BobHi,
There is nothing as such creating variable for navigation attribute. You can only create variable directly on particular infoobject.
In your case you are using transitivie attributes. So they can not be accesed directly in BEX query. You can only use 1st level nagivation attributes in bex query.
[http://help.sap.com/saphelp_nw04/helpdata/en/6f/c7553bb1c0b562e10000000a11402f/content.htm]
Regards,
Durgesh.
Edited by: Durgesh Gandewar on Feb 22, 2012 3:53 PM -
Problem in creating a BDC program for transaction cj20n(project sytem)
Hi all,
I am trying to create project,WBS element ,network and activity using a BDC program,
I am able to create to a recording for the transaction cj20n using tcode shdb but when i run the recording it doesnt run properly i am not able to create any thing.
I get error saying that a particular field doesnt exist on the screen.
Is possible to create a BDC program for transaction CJ20N ?
Also is there any other alternative apart from using a BAPI or a function module.
Thanks,
NishantHi,
Check below link for BAPIs of transaction cj20n.
[BAPI for cj20n|BAPI for CJ20N transaction]
Thanks,
Asit Purbey. -
Creating a service program in inventory results in 'no data found error'
Hi,
i tried creating a service program as was given in the sep 2001 issue of the crm newsletter. While saving the item it results in the following error:
FRM-40735 ON-INSERT trigger raised unhandled exception ORA-01653
ORA-01403 No data Found
What could be the possible cause for the occurrence of this error?
Thanks & Regards,
NithyaYou're doing a lot of unnecessary conversion of dates into character strings and back into dates again.
Keep it simple and just use dates as-is:
SQL> select * from T_REC_PER;
VAL START_PERIOD END_PERIOD
5 15-OCT-2008 00:00:00 30-OCT-2008 00:00:00
6 31-OCT-2008 00:00:00 06-NOV-2008 00:00:00
8 07-NOV-2008 00:00:00 12-NOV-2008 00:00:00
SQL> declare
2 ls_per date := to_date('17-OCT-2008','DD-MON-YYYY');
3 ln_val number;
4 begin
5 select t.val
6 into ln_val
7 from T_REC_PER t
8 where ls_per between t.start_period and t.end_period;
9 dbms_output.put_line(ln_val);
10 end;
11 /
5
PL/SQL procedure successfully completed.
SQL> declare
2 ls_per date := to_date('09-NOV-2008','DD-MON-YYYY');
3 ln_val number;
4 begin
5 select t.val
6 into ln_val
7 from T_REC_PER t
8 where ls_per between t.start_period and t.end_period;
9 dbms_output.put_line(ln_val);
10 end;
11 /
8
PL/SQL procedure successfully completed. -
How to create variables in payroll rules
Hi Experts,
Can you please let me know how to create variables in payroll rules and how to assign values to them.
Please share some documentation on this topic.
Thanks so much,
UttamaHi Vijay,
Variables can be created for -
Char Values
Texts
Formula elements
hierarchy and its nodes
For Characteristic Values -
These are used to be filled by user in the query selection screen
1.In the filter tab of QD, select the characteristic for which you want to create a variable,right click - >Restrict
2.Select variabes from drop down
3.Click Create new variable and then define its properties like "Processing By",Settings in Details tab etc and save it
4.Move it to the right side and click ok
Now you have created a variable and used it as a placeholder for that characteristic for which user can enter the value to act as dyanmic entry.
Regards,
Vineeth -
Hi, i have got another problem with livecycle designer scripting.
I have got script line which is defining of string variable:
var aaa = "this is my string";
and i have got embed XML schema like this (it`s only short part of whole file):
... xs:element name="bbb" type="xs:string"/ ...
After saving data to XML i would like to get "this is my string" as a value of my "bbb" XML element.
To save this data i`m using submit button which is connect with submit.php file on my server.
How to connect script created variable and embed XML schema element which is present on my "Data View" tab.
Please help me a bit becouse i don`t know even where to search answer of it...
Of course i know possibilities to create fake unvisible text field object and bind it with 'bbb' and than put "this.rawValue = aaa" to connect those two variables but i think that is not a good idea to solve it in that way. It`s too primitivei solve it, i should write this:
xfa.datasets.data.bbb.value = aaa; -
Admin console crashes when creating a new program
Recently, .NET 4.5 and Windows 8.1 ADK was installed to update the KMS Host on our server that is shared with the ConfigMgr Primary Site server. Since then, the Admin Console has been crashing every time I try to create a new program on any package
in SCCM (both newly created or existing packages).
smsAdminUILog:
[3][7/07/2014 11:55:07 AM] :Help topic not found in 'HelpTopicLinks.xml' for topic ID: '7e96e251-ed74-4905-87c0-77d082a5fa4d'
[3][7/07/2014 11:56:10 AM] :Property: 'ProgramName'\r\nSystem.Management.ManagementException\r\nNot found \r\n at System.Management.ManagementException.ThrowWithExtendedInfo(ManagementStatus errorCode)
at System.Management.ManagementObject.Initialize(Boolean getObject)
at System.Management.ManagementBaseObject.get_Properties()
at Microsoft.ConfigurationManagement.ManagementProvider.WqlQueryEngine.WqlResultObjectBase.get_Item(String name)\r\nManagementException details:
instance of SMS_ExtendedStatus
Description = "Error retrieving object PackageID=XXX00219";
ErrorCode = 2151811598;
File = "c:\\qfe\\nts_sms_fre\\sms\\siteserver\\sdk_provider\\smsprov\\SspInterface.h";
Line = 1151;
Operation = "GetObject";
ParameterInfo = "SMS_Program.PackageID=\"XXX00219\",ProgramName=\"Test\"";
ProviderName = "ExtnProv";
StatusCode = 2147749890;
\r\n
Event Log:
An error occured in ConfigMgr. The ConfigMgr console will continue to function, however you should save your work and restart the console. After restarting the console, verify that your last configurations have been applied.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.File.Move(String sourceFileName, String destFileName)
at Microsoft.ConfigurationManagement.AdminConsole.SmsTraceListener.SmsTextWriterTraceListener.WriteStringToLog(String message)
at Microsoft.ConfigurationManagement.AdminConsole.SmsTraceListener.SmsTextWriterTraceListener.WriteSmsLogEntry(String source, TraceEventType eventType, TraceEventCache eventCache, Int32 id, String traceMessage)
at System.Diagnostics.TraceSource.TraceEvent(TraceEventType eventType, Int32 id, String message)
at Microsoft.ConfigurationManagement.AdminConsole.ExceptionUtilities.TraceException(Exception ex, TraceEventType traceEventType, Int32 eventId, String message)
at Microsoft.ConfigurationManagement.ManagementProvider.WqlQueryEngine.WqlResultObjectBase.get_Item(String name)
at Microsoft.ConfigurationManagement.AdminConsole.Program.GeneralPageControl.VerifyProgramName()
at Microsoft.ConfigurationManagement.AdminConsole.Program.GeneralWizardPage.get_CanDeactivate()
at Microsoft.ConfigurationManagement.AdminConsole.WizardFramework.WizardForm.OnNext()
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
I tried removing .NET 4.5 and re-installing .NET 4.0, but still crashing.Hi Tim,
I’m experiencing the same issue, but for me it still crashes as guest. I’m hoping someone will have a suggestion. I’m very new to the flash world (in fact I’m taking a class now and wasn’t able to do my homework), so if you get any responses or discover any useful information please let me know.
Thanks,
Naomi -
Concept of variable-free programming.
Can anyone clearly explain the "concept of variable-free programming",
in Object Oriented Programming with a sample code.
Thank you very muchGoogle says:
["variable-free programming" found in Google search|http://books.google.com/books?id=Sz4fsW1CMrIC&pg=PA390&lpg=PA390&dq=concept+of+%22variable-free+programming%22&source=bl&ots=k2E1ea0ENf&sig=zl2lsjo5V-bdXuJvaGEhSjStiZw&hl=en&ei=3avVSfT3FKaMtgOxr72sCg&sa=X&oi=book_result&ct=result&resnum=5#PPA391,M1]
Bottom of page 390 to top of page 391. It's a C# book, but the accessor (getter and setter) concept is certainly used in Java. The whole paragraph could be applied to Java. [Google's book search doesn't let you cut-and-paste the full paragraph, and I don't feel like typing it all myself. ;) ]
Google finds the term elsewhere, too.
That said, I've certainly never heard the term (and, obviously, the other people in the thread haven't heard it, either). -
Creating a XSLT program to delete some part of text in XML file
Hi All,
I have a DMEE which generates an XML file . This file conatins the text " #<?xml version="1.0" encoding="utf-16"?> " in the output file. My requirement is to create XLT program to remove this text before output.
Please help me out in creating an XSLT program as I am completely unaware of this programming technique.Hi
You have to import source and target structure in stylus studio and u have to map according to requirement....
refer thsi links its use ful to u
1./people/prasadbabu.nemalikanti3/blog/2006/03/30/xpath-functions-in-xslt-mapping
the above one is for xslt mapping.
2.http://help.sap.com/saphelp_nw04/helpdata/en/45/06bd029da31 122e10000000a11466f/frameset.htm
The obove one is for communication channel scheduling
if any need
thanq
Maybe you are looking for
-
Standard BI Data Source for FMGLFLEXT
Hello Friends, The standard data source for the Financials New Legder is 0FI_GL_10 General Ledger: Leading Ledger Balances, which fetches the data from the FAGLFLEXT Table using the Extract Structure FAGL_EXTSTRUCT_LEAD. However there has been a migr
-
HT4528 In App Store,.My purchased items won't open!!!!!
I have a iPad, and a Brand New iPhone 4 I got just today 10-16-2012...:( and I can not see none of my purchased items,...my son and girl iPhones do the same thing,...my App Store opens fine,..just none of the apps I have paid for shows,..be ok if I c
-
I've seen this twice now over the last couple of months under Acrobat Pro 9.3.2. I've created forms for folks attending an event to complete. They download these forms from a web site, complete them, and click a button I've built into the form to e-m
-
Onboard Sound Detection in Flash
Hi all, i've taken a look at the computespectrum feature in flash, is there a method in flash that can enable detection from the input sound card itself? Anyone care to share their experience here on that - or sound visualizations made in flash. thx
-
Excess amount paid, but J1INCHLN no open items
Friends, We have paid excess for safe side for tds while paying the challn into bank. While updating the challn updation J1INCHLN we found short amount of open items. How to adjust that, what to do.