ALV 레이아웃의 표시된 모든 열을 제거하는 방법 (How to remove all displayed columns of ALV layout)


문제 설명

ALV 레이아웃의 표시된 모든 열을 제거하는 방법 (How to remove all displayed columns of ALV layout)

스크립트를 사용하여 SAP에서 Excel로 데이터를 내보내고 있습니다. 목표는 이 매크로를 실행하려는 모든 사람이 사용할 수 있도록 하는 것이지만, SAP 레이아웃이 다른 경우 매크로가 엉망이 됩니다. 코드를 파헤쳐 보면 SAP가 각 행에 숫자 값을 할당하는 것처럼 보입니다. 따라서 매크로는 SAP 트랜잭션을 실행한 다음 레이아웃을 변경하고 참조하는 번호에 따라 레이아웃에 표시된 모든 열을 오른쪽으로 덤프합니다. 이제 마지막 열이 항상 같기 때문에 실행할 때 잘 작동하지만 레이아웃이 다른 사람이 실행하면 일부 필드만 제거됩니다.

궁금한 점 VBA에 현재 코드가 아닌 모든 행을 선택하거나 "표시된 열" 버킷을 완전히 지우는 방법이 있는 경우:<


참조 솔루션

방법 1:

Found the answer shortly after posting. Instead of using:

.selectedRows = "0‑27"

I used:

.selectAll

This grabbed everything in the field so I could then repopulate with the information I needed.

(by M. TerryM. Terry)

참조 문서

  1. How to remove all displayed columns of ALV layout (CC BY‑SA 2.5/3.0/4.0)

#vba #sap-gui #excel #scripting #alv






관련 질문

열에 문자열이 포함된 경우 열 번호 나열 (List column numbers if columns contain string)

SpinButton SpinUp 또는 SpinDown 새로 고침 (Refreshing SpinButton SpinUp or SpinDown)

변수를 사용하여 Excel VBA에서 3차원 배열 요소에 액세스 (Use variables to access 3 dimensional array elements in Excel VBA)

TODAY() 함수와 월 1일을 기준으로 범위 이동 (Moving a range based on TODAY() function and first of the month)

ALV 레이아웃의 표시된 모든 열을 제거하는 방법 (How to remove all displayed columns of ALV layout)

셀에 입력한 msoShapeOval은 MsoShapeType으로 선언된 변수의 값이 될 수 없습니다. (msoShapeOval entered in cell not allowed to be value for variable declared as MsoShapeType)

Excel VBA의 세로 열에 여러 json을 생성하는 방법은 무엇입니까? (How to generate multiple json in vertical column in Excel VBA?)

공개 함수의 VBA 런타임 오류 -2147319767(80028029) (VBA Run-time error -2147319767 (80028029) in Public Function)

알 수 없는 수의 문자를 패턴 일치시키는 방법 (How to Pattern Match an Unknown Number of Characters)

Excel VBA 파일이 열려 있는지 확인 기능 (Excel VBA Check if File is open function)

ActiveCell..Offset(-1,0)=을 사용하는 If/And/Then/Else 문의 VBA 문제= (VBA Issue with If/And/Then/Else statement using ActiveCell..Offset(-1,0)=)

VBA 런타임 오류 '1004': 응용 프로그램 정의 또는 개체 정의 오류" 설정 셀 내용 (VBA Runtime Error '1004': Application-defined or Object-defined error" setting cell contents)







코멘트