Query related to alv
Hi Abap gurus,
I need a blank ALV to display with 6 coulumns,where the enduser will fill the details in the alv row wise and he clicks on a button which will save in the z-table with the entries done in alv (edit mode) and then it should export to excel file..
Is it possible to display balnk alv and I need dynamic rows..& my columns are fixed(6)
awaiting for all u r ideas...
Thanks & Regards
Ravi V Ganji
If the data doesnot exist in the internal table you are using for displaying the ALV, you can display a empty ALV. Then you can click on the toolbar buttons to add empty rows which the user can fill in.
Take a look at BCALVEDIT* programs.
BCALV_EDIT_01
BCALV_EDIT_02
BCALV_EDIT_03
BCALV_EDIT_04
BCALV_EDIT_05
BCALV_EDIT_06
BCALV_EDIT_07
BCALV_EDIT_08
Regards,
Ravi
Note : Please mark all the helpful answers
Message was edited by: Ravikumar Allampallam
Similar Messages
-
Query related to alv grid and sap script
Hi All,
I have a requirement where i should read the values which are selected on the alv grid list output and those values i need to display on the script(layout).
Help me out guru's its an urgency...
thanks in advance .
regards
ravi ganjiHi Ravi,
I have done it exactly like your requirement. This program contains ALV and Smartform.
But whatever may be, both are layouts and having driver program. So just finish your driver program and Script layout and then use this program.
I have written this code to print contact letters from VA42. So, modify this code to insert your transaction code.
Let me know if you have any questions.
Here is the code.
REPORT ILETTER MESSAGE-ID CM.
TYPE POOLS (ALV)
TYPE-POOLS:
slis.
Customized Types
TYPES:
BEGIN OF ty_cntrt,
box(1) TYPE c,
kunnr TYPE kunag,
vbeln TYPE vbeln_va,
vbeln1 TYPE vbeln_va,
vposn TYPE posnr,
vuntdat TYPE vudat_veda,
vbegdat TYPE vbdat_veda,
vdemdat TYPE vddat_veda,
venddat TYPE vndat_veda,
END OF ty_cntrt,
single line TYPES
BEGIN OF ty_vkorg,
vkorg TYPE vkorg,
END OF ty_vkorg.
Constants
CONSTANTS:
c_sform TYPE char10 VALUE 'SMARTFORMS',
c_tcode TYPE sy-tcode VALUE 'VA42',
c_mode TYPE c VALUE 'N',
c_updat TYPE c VALUE 'A',
c_batch TYPE sy-callr VALUE 'BATCH',
c_dclick TYPE char10 VALUE '&IC1'.
Internal tables
DATA: it_cntrt TYPE TABLE OF ty_cntrt,
it_bdc TYPE TABLE OF bdcdata,
it_mesg TYPE TABLE OF bdcmsgcoll,
it_const TYPE TABLE OF /SIE/SSG_XCM_CUC,
it_vkorg TYPE TABLE OF ty_vkorg.
Work areas
DATA: wa_cntrt TYPE ty_cntrt,
wa_bdc TYPE bdcdata,
wa_const TYPE /SIE/SSG_XCM_CUC,
w_vbak TYPE vbak,
w_veda TYPE veda,
w_xcm_pr TYPE /sie/ssg_xcm_pr,
w_vkorg TYPE ty_vkorg.
Variables
DATA: l_repid TYPE sy-repid,
l_vakey TYPE vakey,
l_variant TYPE varid-variant,
l_vbeln TYPE i,
l_vkorg TYPE i,
l_vkbur TYPE i,
l_vkgrp TYPE i,
l_ckappl(40) TYPE c,
l_ckschl(40) TYPE c,
l_cauart(40) TYPE c.
Program Constants
DATA: c_kappl TYPE kappl,
c_kschl TYPE kschl,
c_auart TYPE auart,
c_repco TYPE /sie/ssg_xcm_const,
c_value TYPE /sie/ssg_xcm_value.
ALV data declarations
DATA:
gt_fieldcat TYPE slis_t_fieldcat_alv,
gt_tab_group TYPE slis_t_sp_group_alv,
gs_layout TYPE slis_layout_alv,
gs_repid TYPE sy-repid,
gs_sort TYPE TABLE OF slis_sortinfo_alv.
Selection screen
SELECTION-SCREEN BEGIN OF BLOCK indletter WITH FRAME TITLE text-001.
skip one line
SELECTION-SCREEN SKIP.
SELECT-OPTIONS:
contract
so_vbeln FOR w_vbak-vbeln,
category
so_auart FOR w_vbak-auart NO-DISPLAY,
Sales Org
so_vkorg FOR w_vbak-vkorg OBLIGATORY,
Dis Channel
so_vtweg FOR w_vbak-vtweg,
Division
so_spart FOR w_vbak-spart,
Sales Group
so_vkgrp FOR w_vbak-vkgrp,
Sales Office
so_vkbur FOR w_vbak-vkbur OBLIGATORY,
Cancellation Procedure
so_vkues FOR w_veda-vkuesch OBLIGATORY,
Contract Signed Date
so_vuntd FOR w_veda-vuntdat,
created by
so_ernam FOR w_vbak-ernam,
Fixed Indexation formula
so_fnum FOR w_xcm_pr-fnum OBLIGATORY.
skip one line
SELECTION-SCREEN SKIP.
Indexation letter
PARAMETERS: rb_index RADIOBUTTON GROUP radi USER-COMMAND usr.
Follow up report
PARAMETERS: rb_follo RADIOBUTTON GROUP radi.
skip one line
SELECTION-SCREEN SKIP.
Manual processing checkbox
PARAMETERS: p_manpr AS CHECKBOX.
SELECTION-SCREEN END OF BLOCK indletter.
Printer block
SELECTION-SCREEN BEGIN OF BLOCK blk_par WITH FRAME TITLE text-002.
Printer
PARAMETERS: p_print LIKE nast-ldest DEFAULT 'LOCL' OBLIGATORY.
SELECTION-SCREEN END OF BLOCK blk_par.
User selection data validation
AT SELECTION-SCREEN ON so_vkorg.
Ragne for sales org
RANGES: r_vkorg FOR vbak-vkorg.
REFRESH: it_const, r_vkorg.
CLEAR wa_const.
Proceed for execution only for Sales Orgs in /SIE/SSG_XCM_CUC
LOOP AT so_vkorg.
r_vkorg-sign = 'I'.
r_vkorg-option = 'EQ'.
r_vkorg-low = so_vkorg-low.
APPEND r_vkorg.
Check Sales Org intervals entered in the selection screen
IF NOT so_vkorg-high IS INITIAL.
Get all Sales Org for interval
SELECT vkorg FROM tvko INTO TABLE it_vkorg
WHERE vkorg BETWEEN so_vkorg-low AND so_vkorg-high.
IF sy-subrc = 0.
Add all Sales org into one internal table
LOOP AT it_vkorg INTO w_vkorg.
r_vkorg-low = w_vkorg-vkorg.
APPEND r_vkorg.
CLEAR: w_vkorg.
ENDLOOP.
delete repeated records
DELETE ADJACENT DUPLICATES FROM r_vkorg COMPARING low.
ENDIF.
ENDIF.
CLEAR r_vkorg.
ENDLOOP.
Get Sales Org entries maintained in /SIE/SSG_XCM_CUC
l_repid = sy-repid.
Check Sales Org is maintained for Renewal Letter?
LOOP AT r_vkorg.
concatenate constant with Sales Org
CONCATENATE 'INX_LETTER_CREATE_' r_vkorg-low INTO c_repco.
Get constant
SELECT SINGLE value
FROM /sie/ssg_xcm_cuc
INTO c_value
WHERE repid = l_repid
AND const = c_repco
AND vkorg EQ so_vkorg-low.
Check alerady maintained?
IF sy-subrc <> 0 OR
( sy-subrc = 0 AND c_value <> 'X' ).
Issue massage 'Sales Org no permitted for renewal Letter'.
MESSAGE E012.
CLEAR: c_repco, r_vkorg.
EXIT.
ENDIF.
CLEAR: c_repco, r_vkorg.
ENDLOOP.
AT SELECTION-SCREEN.
Read single Sales Org
READ TABLE so_vkorg INDEX 1.
IF sy-subrc = 0.
CLEAR: l_ckappl, l_ckschl, l_cauart, c_kappl, c_kschl, c_auart.
for application
CONCATENATE 'INX_LETTER_V1_' so_vkorg-low INTO l_ckappl.
for output type
CONCATENATE 'INX_LETTER_Y6C4_' so_vkorg-low INTO l_ckschl.
document type
CONCATENATE 'INX_LETTER_AUART_' so_vkorg-low INTO l_cauart.
Get application
SELECT SINGLE value FROM /sie/ssg_xcm_cuc
INTO c_kappl WHERE repid = sy-repid AND const LIKE l_ckappl.
Get output type
SELECT SINGLE value FROM /sie/ssg_xcm_cuc
INTO c_kschl WHERE repid = sy-repid AND const LIKE l_ckschl.
Get document type
SELECT SINGLE value FROM /sie/ssg_xcm_cuc
INTO c_auart WHERE repid = sy-repid AND const LIKE l_cauart.
ENDIF.
find no of Sales org entries entered in the selection screen
DESCRIBE TABLE so_vkorg LINES l_vkorg.
find no of Sales office entries entered in the selection screen
DESCRIBE TABLE so_vkbur LINES l_vkbur.
find no of Sales Group entries entered in the selection screen
DESCRIBE TABLE so_vkgrp LINES l_vkgrp.
Check if enterred more than one entry
IF l_vkorg = 1 AND l_vkbur = 1.
add Sales Org, Sales office, Sales group for key
IF NOT so_vkgrp[] IS INITIAL.
CONCATENATE so_vkorg-low so_vkbur-low so_vkgrp-low INTO l_vakey.
ELSE.
CONCATENATE so_vkorg-low so_vkbur-low '%' INTO l_vakey.
ENDIF.
CONDENSE l_vakey.
Get printer name for selection.
SELECT SINGLE ldest FROM nach INTO p_print
WHERE kappl = c_kappl AND kschl = c_kschl AND vakey LIKE l_vakey.
ENDIF.
Manual processing is possible for Renewal Letter in advance only
IF p_manpr = 'X' AND rb_follo = 'X'.
MESSAGE E017.
ENDIF.
Main Processing
START-OF-SELECTION.
Check for the Follow up report
IF rb_follo = 'X'.
Call Follow up report with Selection criteria
SUBMIT /SIE/SWE_XCM_INDEX_FOLLOWUP
USING SELECTION-SET l_variant
WITH so_vbeln IN so_vbeln
WITH so_vkorg IN so_vkorg
WITH so_vtweg IN so_vtweg
WITH so_spart IN so_spart
WITH so_vkgrp IN so_vkgrp
WITH so_vkbur IN so_vkbur
WITH so_vkues IN so_vkues
WITH so_vuntd IN so_vuntd
WITH so_ernam IN so_ernam
WITH so_fnum IN so_fnum
WITH p_kappl EQ c_kappl
WITH p_kschl EQ c_kschl
WITH p_auart EQ c_auart
AND RETURN.
ELSE.
Process for Indexation Report
gs_repid = sy-repid.
Get data.
PERFORM get_data.
Filter data based on Siemens France rules
PERFORM process_data.
Check contract data is available for selection criteria
IF NOT it_cntrt[] IS INITIAL.
create ALV output header
PERFORM alv_fieldcat USING gt_fieldcat[].
create ALV layout
PERFORM alv_layout CHANGING gs_layout.
Sort ALV output
PERFORM alv_sort.
display filtered contract data
PERFORM output_data.
ELSE.
Display a message 'No records found'.
MESSAGE I011.
EXIT.
ENDIF.
ENDIF.
*& Form get_data
Retrieve contracts data from tables
--> p1 text
<-- p2 text
FORM get_data.
Get contract data from VBAK and VEDA.
SELECT avbeln aaudat a~kunnr
bvuntdat bvbegdat
bvdemdat bvenddat
INTO CORRESPONDING FIELDS OF TABLE it_cntrt
FROM vbak AS a INNER JOIN veda AS b
ON avbeln = bvbeln
WHERE a~vbeln IN so_vbeln
AND a~auart EQ c_auart
AND a~vkorg IN so_vkorg
AND a~vtweg IN so_vtweg
AND a~spart IN so_spart
AND a~vkgrp IN so_vkgrp
AND a~vkbur IN so_vkbur
AND a~ernam IN so_ernam
AND b~vposn = '000000'
AND b~vkuesch IN so_vkues
AND b~vuntdat IN so_vuntd.
ENDFORM. " get_data
*& Form process_data
text
--> p1 text
<-- p2 text
FORM process_data.
Internal tables
DATA: l_nast TYPE TABLE OF nast,
it_pr TYPE TABLE OF /sie/ssg_xcm_pr.
Work areas
DATA: w_nast TYPE nast,
wa_pr TYPE /sie/ssg_xcm_pr.
local Variables
DATA: l_datum1 TYPE sy-datum,
l_datum2 TYPE sy-datum,
l_d3last TYPE sy-datum,
l_d3next TYPE sy-datum.
current date.
l_datum1 = sy-datum.
Calcuate date after 3 months.
CALL FUNCTION 'DATE_CREATE'
EXPORTING
ANZAHL_MONATE = 3
DATUM_EIN = l_datum1
IMPORTING
DATUM_AUS = l_datum2.
l_datum2 = l_datum2 - 1.
SORT it_cntrt BY KUNNR VBELN.
Get corresponding records from /SIE/SSG_XCM_PR.
SELECT vbeln posnr fnum
FROM /SIE/SSG_XCM_PR
INTO CORRESPONDING FIELDS OF TABLE it_pr
FOR ALL ENTRIES IN it_cntrt
WHERE vbeln = it_cntrt-vbeln
AND posnr = it_cntrt-vposn
AND fnum IN so_fnum.
clear workarea
CLEAR wa_cntrt.
filter contracts agaist the table /SIE/SSG_XCM_PR records.
LOOP AT it_cntrt INTO wa_cntrt.
CLEAR wa_pr.
check contracts available in table /SIE/SSG_XCM_PR
READ TABLE it_pr INTO wa_pr WITH KEY vbeln = wa_cntrt-vbeln.
IF sy-subrc <> 0.
DELETE it_cntrt.
CLEAR wa_pr.
CONTINUE.
ELSEIF sy-subrc = 0 AND NOT wa_pr-fnum IN so_fnum.
if not available, do not consider this contract
DELETE it_cntrt.
CLEAR wa_pr.
CONTINUE.
ENDIF.
Dont consider contracts expires before today and after 3 months.
IF wa_cntrt-vdemdat > l_datum1. "current date
IF wa_cntrt-vdemdat(6) > l_datum2(6). "AND "after 3 months
delete contract
DELETE it_cntrt.
CLEAR wa_cntrt.
CONTINUE.
ENDIF.
ELSE.
DELETE it_cntrt.
CLEAR wa_cntrt.
CONTINUE.
ENDIF.
Is contract renewal letter has been sent already?
Get all records from NAST to find letter sent?
SELECT kappl objky kschl nacha datvr
FROM NAST
INTO CORRESPONDING FIELDS OF TABLE l_nast
WHERE kappl = c_kappl
AND objky = wa_cntrt-vbeln
AND kschl = c_kschl
AND nacha = '1'.
IF sy-subrc = 0.
sort renewal letter sent dates by latest is first
SORT l_nast BY datvr DESCENDING.
Get latest nast record
READ TABLE l_nast INTO w_nast INDEX 1.
IF sy-subrc = 0.
IF p_manpr <> 'X'. " ignore 3 month logic
l_d3next = wa_cntrt-vdemdat(06).
l_d3next+6(2) = '01'.
Calcuate date after 3 months.
CALL FUNCTION 'DATE_CREATE'
EXPORTING
ANZAHL_MONATE = -3
DATUM_EIN = l_d3next
IMPORTING
DATUM_AUS = l_d3last.
l_d3last = l_d3last + 1.
Check letter already sent year equals current year
IF w_nast-datvr BETWEEN l_d3last AND wa_cntrt-vdemdat.
do not consider it
DELETE it_cntrt.
CLEAR: l_d3last, wa_cntrt, w_nast, l_d3next.
CONTINUE.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
no leading zeros to contract
WRITE wa_cntrt-vbeln TO wa_cntrt-vbeln1 NO-ZERO.
modify internal table
MODIFY it_cntrt FROM wa_cntrt.
CLEAR: l_nast, w_nast.
ENDLOOP.
ENDFORM. " process_data
*& Form output_data
text
--> p1 text
<-- p2 text
FORM output_data.
Display output in a ALV Grid
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = gs_repid
I_CALLBACK_PF_STATUS_SET = 'ALV_STATUS'
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
IS_LAYOUT = gs_layout
IT_FIELDCAT = gt_fieldcat
IT_SORT = gs_sort
I_SAVE = 'A'
TABLES
T_OUTTAB = it_cntrt
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. " output_data
*& Form alv_header
text
--> p1 text
<-- p2 text
FORM alv_fieldcat USING gs_fieldcat TYPE slis_t_fieldcat_alv.
DATA: ls_fieldcat TYPE slis_fieldcat_alv.
Sold-to Party header
ls_fieldcat-col_pos = 1.
ls_fieldcat-fieldname = 'KUNNR'.
ls_fieldcat-seltext_m = 'Sold-to Party'.
ls_fieldcat-outputlen = 14.
ls_fieldcat-datatype = 'CHAR'.
ls_fieldcat-key = 'X'.
APPEND ls_fieldcat TO gs_fieldcat.
CLEAR ls_fieldcat.
Contract number
ls_fieldcat-col_pos = 2.
ls_fieldcat-fieldname = 'VBELN'.
ls_fieldcat-seltext_m = 'Contract Number'.
ls_fieldcat-outputlen = 20.
ls_fieldcat-datatype = 'CHAR'.
APPEND ls_fieldcat TO gs_fieldcat.
CLEAR ls_fieldcat.
Contract Signed Date
ls_fieldcat-col_pos = 3.
ls_fieldcat-fieldname = 'VUNTDAT'.
ls_fieldcat-seltext_m = 'Contract signed date'.
ls_fieldcat-outputlen = 20.
ls_fieldcat-datatype = 'DATS'.
APPEND ls_fieldcat TO gs_fieldcat.
CLEAR ls_fieldcat.
Contract Start Date
ls_fieldcat-col_pos = 4.
ls_fieldcat-fieldname = 'VBEGDAT'.
ls_fieldcat-seltext_m = 'Contract start date'.
ls_fieldcat-outputlen = '20'.
ls_fieldcat-datatype = 'DATS'.
APPEND ls_fieldcat TO gs_fieldcat.
CLEAR ls_fieldcat.
Dismantling date
ls_fieldcat-col_pos = 5.
ls_fieldcat-fieldname = 'VDEMDAT'.
ls_fieldcat-seltext_m = 'Dismantling date'.
ls_fieldcat-outputlen = 14.
ls_fieldcat-datatype = 'DATS'.
APPEND ls_fieldcat TO gs_fieldcat.
CLEAR ls_fieldcat.
ENDFORM. " alv_header
*& Form alv_layout
text
--> p1 text
<-- p2 text
FORM alv_layout USING ls_layout TYPE slis_layout_alv.
No input
ls_layout-no_input = 'X'.
Column width is flexible
ls_layout-colwidth_optimize = 'X'.
ls_layout-box_fieldname = 'BOX'.
ls_layout-info_fieldname = 'LINE_COLOR'.
ls_layout-zebra = 'X'.
ls_layout-get_selinfos = 'X'.
ls_layout-reprep = 'X'.
ENDFORM. " alv_layout
*& Form alv_status
text
--> p1 text
<-- p2 text
FORM alv_status USING rt_extab TYPE slis_t_extab.
GUI Status and Application Toolbar
SET PF-STATUS '/SIE/SWE_XCM_INDEXLE'.
ENDFORM.
*& Form user_command
text
--> p1 text
<-- p2 text
FORM user_command USING l_ucomm LIKE sy-ucomm
l_selfield TYPE slis_selfield.
RANGES: r_kappl FOR nast-kappl,
r_objky FOR nast-objky,
r_kschl FOR nast-kschl,
r_nacha FOR nast-nacha.
DATA: l_jobname TYPE TBTCJOB-JOBNAME,
l_jobcount TYPE TBTCJOB-JOBCOUNT,
l_repid TYPE sy-repid,
l_print_params TYPE PRI_PARAMS,
l_arc_params TYPE ARC_PARAMS,
l_valid TYPE c,
l_retcode TYPE sy-subrc,
l_blines TYPE i.
CASE l_ucomm.
Process button seleted
WHEN c_sform.
process selected records.
LOOP AT it_cntrt INTO wa_cntrt.
IF wa_cntrt-box = 'X'.
place output type in the contract
PERFORM bdc_output USING wa_cntrt
CHANGING l_retcode.
IF l_retcode = 0.
add record for jobground job
r_objky-sign = 'I'.
r_objky-option = 'EQ'.
r_objky-low = wa_cntrt-vbeln.
APPEND r_objky.
ENDIF.
CLEAR: wa_cntrt, l_retcode, r_objky.
ENDIF.
ENDLOOP.
WHEN c_dclick.
set contract number id with the selected contract
SET PARAMETER ID 'AUN' FIELD l_selfield-value.
SET PARAMETER ID 'KTN' FIELD l_selfield-value.
call va42 tcode when double click on contract
CALL TRANSACTION c_tcode AND SKIP FIRST SCREEN.
ENDCASE.
DESCRIBE TABLE r_objky LINES l_blines.
IF NOT r_objky[] IS INITIAL.
IF l_blines > 0.
Background job name.
CONCATENATE 'XCM_INDEXATION' sy-uname '_' sy-uzeit
INTO l_jobname.
Application
r_kappl-sign = 'I'.
r_kappl-option = 'EQ'.
r_kappl-low = 'V1'.
APPEND r_kappl.
Message Type
r_kschl-sign = 'I'.
r_kschl-option = 'EQ'.
r_kschl-low = c_kschl.
APPEND r_kschl.
Message transmission medium
r_nacha-sign = 'I'.
r_nacha-option = 'EQ'.
r_nacha-low = '1'.
APPEND r_nacha.
l_repid = sy-repid.
Print Parameters
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING
DESTINATION = p_print
MODE = c_batch
NO_DIALOG = 'X'
REPORT = l_repid
EXPIRATION = 2
IMMEDIATELY = 'X'
NEW_LIST_ID = 'X'
IMPORTING
OUT_ARCHIVE_PARAMETERS = l_arc_params
OUT_PARAMETERS = l_print_params
VALID = l_valid
EXCEPTIONS
ARCHIVE_INFO_NOT_FOUND = 1
INVALID_PRINT_PARAMS = 2
INVALID_ARCHIVE_PARAMS = 3
OTHERS = 4.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
opening the job
CALL FUNCTION 'JOB_OPEN'
EXPORTING
JOBNAME = l_jobname
IMPORTING
JOBCOUNT = l_jobcount
EXCEPTIONS
CANT_CREATE_JOB = 1
INVALID_JOB_DATA = 2
JOBNAME_MISSING = 3
OTHERS = 4.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Job submit
SUBMIT /sie/swe_xcm_index_rsnast00 TO SAP-SPOOL
USER sy-uname
WITH s_kappl IN r_kappl
WITH s_objky IN r_objky
WITH s_kschl IN r_kschl
WITH s_nacha IN r_nacha
WITH p_print EQ p_print
VIA JOB l_jobname NUMBER l_jobcount
SPOOL PARAMETERS l_print_params
WITHOUT SPOOL DYNPRO
AND RETURN.
IF sy-subrc <> 0.
display message when error in scheduling background job
MESSAGE E016 WITH 'Error scheduling Job'.
ENDIF.
Job close
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
JOBCOUNT = l_jobcount
JOBNAME = l_jobname
STRTIMMED = 'X'
EXCEPTIONS
CANT_START_IMMEDIATE = 1
INVALID_STARTDATE = 2
JOBNAME_MISSING = 3
JOB_CLOSE_FAILED = 4
JOB_NOSTEPS = 5
JOB_NOTEX = 6
LOCK_FAILED = 7
OTHERS = 8.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDIF.
ENDFORM.
*& Form bdc_output
text
--> p1 text
<-- p2 text
FORM bdc_output USING wa_cntrt TYPE ty_cntrt
CHANGING l_retcode TYPE sy-subrc.
DATA: l_nast TYPE TABLE OF nast,
it_nast TYPE TABLE OF nast,
w_nast TYPE nast,
l_cellno(2) TYPE n,
l_vbelv TYPE vbfa-vbelv,
l_vbpa TYPE vbpa,
l_yes(1),
l_temp(40) TYPE c,
l_lines TYPE i,
l_lesscnt TYPE i,
l_less(1),
l_lines1(2) TYPE n.
REFRESH: it_nast, l_nast, it_bdc.
CLEAR: l_nast, w_nast, l_yes, l_cellno,
it_nast, l_nast, it_bdc.
PERFORM dyn_scr USING 'SAPMV45A' '0102' 'X'.
PERFORM dyn_fld USING 'VBAK-VBELN' wa_cntrt-vbeln.
PERFORM dyn_fld USING 'BDC_OKCODE' '/00'.
PERFORM dyn_scr USING 'SAPMV45A' '4001' 'X'.
PERFORM dyn_fld USING 'BDC_OKCODE' '=HEAD'.
PERFORM dyn_scr USING 'SAPMV45A' '4002' 'X'.
PERFORM dyn_fld USING 'BDC_OKCODE' '=KDOK'.
SELECT *
FROM nast
INTO CORRESPONDING FIELDS OF TABLE l_nast
WHERE kappl = c_kappl
AND objky = wa_cntrt-vbeln.
IF sy-subrc = 0.
SORT l_nast BY kschl vstat.
DESCRIBE TABLE l_nast LINES l_lines.
LOOP AT l_nast INTO w_nast.
l_cellno = sy-tabix.
IF w_nast-kschl = c_kschl AND w_nast-vstat = 0.
EXIT.
ENDIF.
IF w_nast-kschl > c_kschl OR
( w_nast-kschl = c_kschl AND w_nast-vstat <> 0 ).
IF l_less = space.
l_cellno = l_cellno - 1.
ENDIF.
CLEAR l_less.
IF l_cellno = 0.
l_cellno = 1.
ENDIF.
l_lines = l_lines + 1.
l_lines1 = l_lines.
PERFORM dyn_scr USING 'SAPDV70A' '0100' 'X'.
CONCATENATE 'DNAST-KSCHL(' l_lines1 ')' INTO l_temp.
CONDENSE l_temp.
PERFORM dyn_fld USING l_temp 'Y6C4'.
CLEAR: l_temp, l_lines, l_lines1.
PERFORM dyn_fld USING 'BDC_OKCODE' '/00'.
EXIT.
ELSEIF w_nast-kschl < c_kschl.
l_less = 'X'.
l_lesscnt = l_lesscnt + 1.
ENDIF.
ENDLOOP.
ELSE.
l_cellno = '01'.
PERFORM dyn_scr USING 'SAPDV70A' '0100' 'X'.
CONCATENATE 'DNAST-KSCHL(' l_cellno ')' INTO l_temp.
CONDENSE l_temp.
PERFORM dyn_fld USING l_temp 'Y6C4'.
CLEAR l_temp.
PERFORM dyn_fld USING 'BDC_OKCODE' '/00'.
ENDIF.
IF l_less = 'X'.
l_lesscnt = l_lesscnt + 1.
l_cellno = l_lesscnt.
l_lines = l_lines + 1.
l_lines1 = l_lines.
PERFORM dyn_scr USING 'SAPDV70A' '0100' 'X'.
CONCATENATE 'DNAST-KSCHL(' l_lines1 ')' INTO l_temp.
CONDENSE l_temp.
PERFORM dyn_fld USING l_temp 'Y6C4'.
CLEAR: l_temp, l_lines, l_lines1.
PERFORM dyn_fld USING 'BDC_OKCODE' '/00'.
ENDIF.
PERFORM dyn_scr USING 'SAPDV70A' '0100' 'X'.
CONCATENATE 'DV70A-SELKZ(' l_cellno ')' INTO l_temp.
CONDENSE l_temp.
PERFORM dyn_fld USING l_temp 'X'.
CLEAR l_temp.
PERFORM dyn_fld USING 'BDC_OKCODE' '=V70P'.
PERFORM dyn_scr USING 'SAPDV70A' '0101' 'X'.
PERFORM dyn_fld USING 'NAST-LDEST' p_print.
PERFORM dyn_fld USING 'NAST-DIMME' 'X'.
PERFORM dyn_fld USING 'NAST-TDARMOD' '1'.
PERFORM dyn_fld USING 'BDC_OKCODE' '=V70B'.
PERFORM dyn_scr USING 'SAPDV70A' '0100' 'X'.
CONCATENATE 'DV70A-SELKZ(' l_cellno ')' INTO l_temp.
CONDENSE l_temp.
PERFORM dyn_fld USING l_temp 'X'.
CLEAR l_temp.
PERFORM dyn_fld USING 'BDC_OKCODE' '=V70I'.
PERFORM dyn_scr USING 'SAPDV70A' '0102' 'X'.
PERFORM dyn_fld USING 'NAST-VSZTP' '1'.
PERFORM dyn_fld USING 'BDC_OKCODE' '=V70B'.
PERFORM dyn_scr USING 'SAPDV70A' '0100' 'X'.
PERFORM dyn_fld USING 'BDC_OKCODE' '=V70S'.
CALL TRANSACTION c_tcode USING it_bdc
MODE c_mode "'N'
UPDATE c_updat "'A'
MESSAGES INTO it_mesg.
IF sy-subrc = 0.
l_retcode = 0.
ENDIF.
ENDFORM. " bdc_output
*& Form dyn_scr
text
-->P_0642 text
-->P_0643 text
-->P_0644 text
FORM dyn_scr USING P_0642
P_0643
P_0644.
MOVE: p_0642 TO wa_bdc-program,
p_0643 TO wa_bdc-dynpro,
p_0644 TO wa_bdc-dynbegin.
APPEND wa_bdc TO it_bdc.
CLEAR wa_bdc.
ENDFORM. " dyn_scr
*& Form dyn_fld
text
-->P_0654 text
-->P_0655 text
FORM dyn_fld USING P_0654
P_0655.
MOVE: p_0654 TO wa_bdc-fnam,
p_0655 TO wa_bdc-fval.
APPEND wa_bdc TO it_bdc.
CLEAR wa_bdc.
ENDFORM. " dyn_fld
*& Form alv_sort
text
FORM alv_sort.
DATA: wa_sortcat TYPE slis_sortinfo_alv.
WA_SORTCAT-SPOS = 1.
WA_SORTCAT-FIELDNAME = 'KUNNR'.
WA_SORTCAT-UP = 'X'.
WA_SORTCAT-EXPA = 'X'.
Appending gd_sortcat-tabname
APPEND WA_SORTCAT TO gs_sort.
CLEAR wa_sortcat.
WA_SORTCAT-SPOS = 2.
WA_SORTCAT-FIELDNAME = 'VBELN'.
WA_SORTCAT-UP = 'X'.
WA_SORTCAT-EXPA = 'X'.
Appending gd_sortcat-tabname
APPEND WA_SORTCAT TO gs_sort.
WA_SORTCAT-SPOS = 3.
WA_SORTCAT-FIELDNAME = 'VUNTDAT'.
WA_SORTCAT-UP = 'X'.
WA_SORTCAT-EXPA = 'X'.
Appending gd_sortcat-tabname
APPEND WA_SORTCAT TO gs_sort.
ENDFORM. " alv_sort -
Hi All,
I want to read the sub total amount which is displayed on the grid when i double click on it or I want to read the whole line where the subtotal amount is displayed.
Help me out guru's....
Thanks in advance.
Regards,
Ravi Ganjijust try once and check rs_selfield-value in debug mode
U can transfer the rs_selfield-value to another temp variable... this will give the subtotal into another internal table
form status using p_extab type slis_t_extab.
set pf-status 'STATUS' excluding p_extab.
endform. "STATUS
*& Form USER_COMMAND
text
-->R_UCOMM text
-->RS_SELFIELD text
form user_command using r_ucomm like sy-ucomm
rs_selfield type slis_selfield.
case r_ucomm.
when 'BACK' or 'CANC' or 'EXIT'.
leave to screen 0.
when '&IC1'.
if rs_selfield-fieldname = 'VBELN'.
call function 'CONVERSION_EXIT_ALPHA_INPUT'
exporting
input = rs_selfield-value
importing
output = temp_vbeln.
TEMP_VBELN = RS_SELFIELD-VALUE.
perform get_data_vbrp.
perform get_second_screen_display.
endif.
endcase.
endform. "USER_COMMAND -
Query relating to the creation of Managed Service Accounts
Hi Folks
I am studying for my 70-411 exam and have a query relating to the creation of Managed Service Accounts.
I have successfully created an MSA account named 'MSATest' on a DC using:
new-adserviceaccount -name msatest –dnshostname home-dc-01 -passthru
and
add-AdcomputerServiceAccount -identity home-ap-01 -serviceaccount msatest -passthru
However the guide that I am using now says that I now need to run: Install-ADServiceAccount on the host computer in the domain to install the MSA in order to make available it available for use by services.
So on my member server (home-ap-01) I have installed the Active Directory Module for powershell and ran:
PS C:\Users\administrator.PCECORP> Install-ADServiceAccount -Identity msatest
Install-ADServiceAccount : Cannot install service account. Error Message: 'An
unspecified error has occurred'.
At line:1 char:1
+ Install-ADServiceAccount -Identity msatest
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : WriteError: (msatest:String) [Install-ADServiceA
ccount], ADException
+ FullyQualifiedErrorId : InstallADServiceAccount:PerformOperation:Install
ServiceAcccountFailure,Microsoft.ActiveDirectory.Management.Commands.Insta
llADServiceAccount
PS C:\Users\administrator.PCECORP>
However this errors, Have I misunderstood the purpose of the Install-ADServiceAccount ? or am I doing something wrong?
Thanks in advance for you help.Try using -RestrictToSingleComputer parameter when creating service account with New-ADServiceAccount.
Gleb.
Hi Gleb
Thank you for your help, it is appreciated. That did the trick.
All the best. -
Query related to multiple attachments in mail adapter
Hi,
I have a query related to multiple attachments in receiver mail adapter.
I have successfully configured mail related scenarios but now I have another requirement in which I have multiple source files in one directory and I want to send one mail for multiple files as mail attachment using receiver mail adapter. Can anybody help me how to achieve multiple attachments in reciever mail adapter.
To clarify the requirement more let us take an example
Ex: I have 5 input files in the source which I pick up using additional files option in the sender file adapter, now I want to send those 5 files into one mail with 5 attachments. Can anybody explain how 5 different payload will be sent as multiple attachments in one mail.
For your information I used, options like "keep attachments" , some parameters in module processesors etcs...but not able to find out as how exactly it will be achieved.......I dont want to use BPM collect pattern for this.....
Need your help on this issue. Please suggest the solution as how it can be achieved using receiver mail adapter.
Thanks & Regards
PrabhatHi,
I resolved the issue on my own. Thanks for your help and support.
Thanks & Regards
Prabhat -
Query related to Email adapter
Hi,
I have query related to receiver Email adapter. I am able to run a scenario for 2 attachments in receiver mail adapter scenario.
My scenario is that I am picking up the multiple files using sender file adapter "additonal fiiles" fucntionality and and post the two files as attachments in receiver email adapter. I am picking up two formats: .xml file and PDF and successfully attached to the receiver email adapter.
My query is is related to Standard module processors sequence.
For 3 files in mail attachments(.xml , pdf & .txt) what should be the module processors sequence in receiver email adapter?
Currently I am using the following module processors sequence
1 localejbs/AF_Modules/MessageTransformBean Local Enterprise Bean trans2
2 localejbs/AF_Modules/PayloadSwapBean Local Enterprise Bean swap
3 localejbs/AF_Modules/MessageTransformBean Local Enterprise Bean trans1
4 sap.com/com.sap.aii.adapter.mail.app/XIMailAdapterBean Local Enterprise Bean mail
swap -> swap.keyName -> payload-name
swap> swap.keyValue> file1
trans1> Transform.ContentDescription>file1
trans1> Transform.ContentDisposition>attachment
trans1> Transform.ContentType>application/pdf;name="file1.pdf"
trans2>Transform.ContentDescription>file1
trans2>Transform.ContentDescription>inline
Can any body tell me what should be the sequence of module processors and the associated parameters so that all formats(.xml , pdf & .txt) should go as an attachments in the reciever email adapter.
Thanks & Regards
Prabhatit would be something like this, Try this
1 localejbs/AF_Modules/PayloadSwapBean Local Enterprise Bean swaptxt
2 localejbs/AF_Modules/MessageTransformBean Local Enterprise Bean trans3
3 localejbs/AF_Modules/PayloadSwapBean Local Enterprise Bean swapxml
4 localejbs/AF_Modules/MessageTransformBean Local Enterprise Bean trans2
5 localejbs/AF_Modules/PayloadSwapBean Local Enterprise Bean swappdf
6 localejbs/AF_Modules/MessageTransformBean Local Enterprise Bean trans1
7 sap.com/com.sap.aii.adapter.mail.app/XIMailAdapterBean Local Enterprise Bean mail
swapxml -> swap.keyName -> payload-name
swapxml> swap.keyValue> file2
swappdf -> swap.keyName -> payload-name
swappdf> swap.keyValue> file1
trans1> Transform.ContentDescription>file1
trans1> Transform.ContentDisposition>attachment
trans1> Transform.ContentType>application/pdf;name="file1.pdf"
trans2>Transform.ContentDescription>file2
trans2>Transform.ContentDisposition>attachment
trans2> Transform.ContentType>application/xml;name="file2.xml"
trans3> Transform.ContentDescription>file3
trans3> Transform.ContentDisposition>attachment
trans3> Transform.ContentType>application/txt;name="file3.txt"
mail --> mime.contenttype --> multipart/mixed
I have not tried this myself. but it should work -
Hello All,
We are in process of implementing Exchange 2013 in our Organization and had a Query related to GAL.
Below is our Environment description:
01. We have a Single Forest and Single Domain Architecture.
02. We will have separate Active Directory Sites for all 3 Regions across Global.
03. Exchange 2013 will be installed in each region.
04. In APAC region Exchange 2013 Language pack for Japanese will be installed to support Japanese language.
Our Requirement:
================
01. When a Japanese User tries to browse GAL all the display names have to be displayed in Japanese language and when a user who resides other Region (Europe or AMERICAS) tries to browse GAL the Address list has to be displayed in default English Language.
Can someone guide us on how this can be achieved?
Awaiting for all your suggestions.
Thanks in advance.
Thanks & Regards,
Nagaraj N
Nagaraj NHi Nagaraj,
Here are some requirements that I am still not quite sure. Could you please provide more information about it? Such as:
1. Do you mean one user have two display names: one with Japanese language used for users in Japan, one with English language used for English users? Then we filter address lists with language difference. Based on my knowledge, one email address is generally
involved for one display name.
2. If there are both Japanese users and English Language users in the forest, and you just need Japanese users view users whose name is displayed as Japanese language. We can use
Address book policies (ABPs) to segment users into specific groups to provide customized views of your organization’s global address list (GAL).
To show different GAL for different users, we can specify the CustomAttribute1-15 property to divide your organizations. For example, we can set the CustomAttribute15 property for Japanese users to
Japan. Just like:
Set-Mailbox –Identity JapanUser1 –CustomAttribute15 Japan
Then we can create global address list for Japanese that includes all of the recipients that exists in the address lists and room address list:
New-GlobalAddressList -Name "GAL_Japan" -RecipientFilter {(CustomAttribute15 -eq "Japan")}
For detailed steps about how to create and apply the Address Book Policies, please refer to:
http://technet.microsoft.com/en-us/library/jj657455(v=exchg.150).aspx
Hope it helps.
Regards,
Winnie Liang
TechNet Community Support -
Query related to DataGuard Archicture...
Hi All,
I want to implement DataGuard Archicture in my setup, I'hv one query related to different operating system in my setup, I'hv two server one for primary and the other for standby Database with 10g DB R2. In one server having Linux os and the other own has Solaris, so DataGuard will work on different os or both server os should be same? And if I'hv 2 GB then will it be create any prob?
pl. suggest me.A requirement for standby is both databases must be on the same platform and on the same db version, this requirement applies even if you are on a logical or on a physical dataguard database.
You can verify the Step by Step instructions to create a standby database:
Step-byStep Instructions for Creating a Logical Standby Database
Step-by-Step Instructions for Creating a Physical Standby Database
~ Madrid -
Hi Freinds,
This is mamatha i have a query related to withhold tax .what is diff b/w business place and section code.what is importance of section code.
Regards
S Mamatha
Please, search SDNFor India, witholding tax, you need to create the business place and section code with the same id.
Section code is additional field provided by sap for tds related processig, reports etc.
Regards,
SDNer -
Query related to the transfer of the control to the other controller.
Hi all,
I have a query related to the transfer of the control to the other controller.
I have components A and B .From a view of component A I neeed to open a window which belong to component B.Problem is that ,if I use create_window_for_cmp_usage( ) and the open( ) method and after that there is some code,then that code is getting executed before the window is opening.
I want that the control should be back to the these code after the window is poped up and after clossing the window.
Eg
method ONACTIONOPEN_WINDOW .
DATA lo_window_manager TYPE REF TO if_wd_window_manager.
DATA lo_api_component TYPE REF TO if_wd_component.
DATA lo_window TYPE REF TO if_wd_window.
lo_api_component = wd_comp_controller->wd_get_api( ).
lo_window_manager = lo_api_component->get_window_manager( ).
lo_window = lo_window_manager->create_window_for_cmp_usage(
interface_view_name = 'ZHELLO_WORLD'
component_usage_name = 'USAGE_HELLO'
title =
close_in_any_case = abap_true
message_display_mode = if_wd_window=>co_msg_display_mode_selected
lo_window->open( ).
data a type i.
data b type i.
a = 2.
b = 3.
a = a + b.
endmethod.
In this case I am calling ONACTIONOPEN_WINDOW method.But before opening the window the a iscalculated here.I want that after popuping the window the calculations should be done .
How will I achieve this.
Thanks in advance.
Edited by: vaibhav nirmal on Nov 25, 2008 6:42 AMHi,
You will have to do your calculation as an event in your new window, or capture the closing of the new window as an event in your currenbt view and do your calculations in the event.
Regards,
Shruthi R -
Query related to User License.
Hi all,
I have some query related to User License.
If we have 250 no of user license( with one developer),
can we use them individually on DEV, QAS & PRD ?
can we use them individually on differrent clients?
what abt users on 000 client. Is they should different license or come under same group.
Regards,
shanContact you SAP Account Manager.
Regards
Juan -
Query related to Internal Table
Hi ,
I have a small query related to internal table , can we dump millions of records to an internal .
The actual requirment is like i need to develop a report in BI side where i have to dump records into an internal table from PSA tables without filtering .
Can we do so ....
or do we have any other option to dump the data to an internal tables .
need some tips on the same .
Thanks ,
VInay.Hello Vinay,
I believe the following extract will give you a brief idea on the size limitations for an internal table.......
Internal tables are dynamic data objects, since they can contain any number of lines of a particular type. The only restriction on the number of lines an internal table may contain are the limits of your system installation. <u><i>The maximum memory that can be occupied by an internal table (including its internal administration) is 2 gigabytes. A more realistic figure is up to 500 megabytes. An additional restriction for hashed tables is that they may not contain more than 2 million entries.</i></u>
Hope it proved useful
Reward if helpful
Regards
Byju -
Query related to OA framework.
HI all,
I have one query related to OA framework.
Query : I have one business requirement to add/update one choice fields on receivables page and base on user input’s I have to add this choice in sql query and want to display result that is controller .( As of now everything is there only I want to add one more choice on page ).
So I am looking for solution what to do . As I am new in OA framework.
First of all I want to pull out all files and want to check /modify on my user desktop once it will work normal then I will start modify .
So for that what I have to do (I have to pull out all files from server ) . ?
Thanks in advance,
RajRaj,
I have already replied that you will find the details for setup in some of the old threads. Its always better to look into old threads for generic issues. If you have got any specific OAF issue, ppl are always here to help you.
--Shiv -
Query related to RSA3 transaction
Hi Guys ,
I have query related to RSA3 transaction screen in that you can see in
settings
Data Records / Calls = 100
Display Extr. Calls = 10 by default .
can this value can be made to 1000 and 1000 as a default value as soon as screen get displayed without manually changed .
can we creat any variant for this ,will it be possible .
i need some suggestion related to this .
valuble answers will be surly rewarded .
Thanks ,
Vinay .Do any one have any suggestion how to solve the query
-
Query related to filter group on matnr created in ALE distribution model
Hi All,
I have query related to filter group on matnr created in ALE distribution model.
I have created a filter group on matnr in ALE distribution model and put the value E* ( purpose is that all the material number started with E should be triggered in case of any changes in the material).But it is not working.
<b>Can anybody suggest the solution for this i.e how to capture E* value for the material master changes and should trigger idoc using change pointer using BD21.</b>
Thanks & Regards
PrabhatUnfortunately, you cannot filter using wildcards or exclusions. You have to explicitly list each allowed value in its entirety.
In my opinion, the simplest solution would be to copy function MASTERIDOC_CREATE_SMD_MATMAS, modify it to handle your custom filtering and update the message type entry in transaction BD60.
Maybe you are looking for
-
How do I keep the command window open?
I want to write a batch file that will leave the window open after running so I can see what the output is. I kind of remember having to use %k But I'm not sure exactly how to do it. UPDATE: I found what I was looking for, it's /k when you execute th
-
Synatax Query - Less than or Equal to
Running on Linux, Apache, MySQL, PHP I have an issue with a date query - possibly created by the MySQL format YYYY-MM-DD I want to create a recordset where activities are less than or equal to today's date. I've managed most of it but the result seem
-
Error 56 in TCP IP Communication
Hi All, I am developing Test Cases to Test our Product, I am using TCP IP Communication to communicate the Hardware (Not NI Hardware) where a firmware is running inside. in the test cases i will communicate the firmware and request it to give me req
-
Handling Scroll bar in SHDB recording
hi, can any one help me in handling scroll bar events while recording a transaction which is further used in BDC. thanks in advance, Swamy mantha.
-
I get a message-error opening installationlog file. Verify that the specified lof file location exists and is writeable-when I try to uninstall iTunes and other components. How can I uninstall and reinstall iTunes?